|
JBoss Metadata Common 7.0.1.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.metadata.parser.util.MetaDataElementParser
public class MetaDataElementParser
Nested Class Summary | |
---|---|
static class |
MetaDataElementParser.DTDInfo
|
Field Summary |
---|
Fields inherited from interface javax.xml.stream.XMLStreamConstants |
---|
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT |
Constructor Summary | |
---|---|
MetaDataElementParser()
|
Method Summary | ||
---|---|---|
protected static boolean |
attributeHasNamespace(XMLStreamReader reader,
int i)
|
|
protected static XMLStreamException |
duplicateNamedElement(XMLStreamReader reader,
String name)
Get an exception reporting that an element of a given type and name has already been declared in this scope. |
|
boolean |
equals(Object obj)
Determine if this object is the same as the given object. |
|
protected static String |
getElementText(XMLStreamReader reader)
Read the element text, with trimming. |
|
protected static String |
getElementText(XMLStreamReader reader,
boolean trim)
Read and return the element text. |
|
int |
hashCode()
Get the identity hash code of this object. |
|
protected static XMLStreamException |
missingRequired(XMLStreamReader reader,
Set<?> required)
Get an exception reporting a missing, required XML attribute. |
|
protected static XMLStreamException |
missingRequiredElement(XMLStreamReader reader,
Set<?> required)
Get an exception reporting a missing, required XML child element. |
|
protected static QName |
parseQName(XMLStreamReader reader,
String qname)
|
|
protected static boolean |
readBooleanAttributeElement(XMLStreamReader reader,
String attributeName)
Read an element which contains only a single boolean attribute. |
|
protected static String |
readDTDLocation(XMLStreamReader reader)
|
|
protected static String |
readSchemaLocation(XMLStreamReader reader)
|
|
protected static String |
readStringAttributeElement(XMLStreamReader reader,
String attributeName)
Read an element which contains only a single string attribute. |
|
protected static void |
requireNoAttributes(XMLStreamReader reader)
Checks that the current element has no attributes, throwing an XMLStreamException
if one is found. |
|
protected static void |
requireNoContent(XMLStreamReader reader)
Consumes the remainder of the current element, throwing an XMLStreamException
if it contains any child elements. |
|
protected static
|
safeCopyMap(NavigableMap<K,V> toCopy)
Returns a new TreeMap by passing the provided map to its constructor. |
|
static XMLStreamException |
unexpectedAttribute(XMLStreamReader reader,
int index)
Get an exception reporting an unexpected XML attribute. |
|
protected static XMLStreamException |
unexpectedElement(XMLStreamReader reader)
Get an exception reporting an unexpected XML element. |
|
protected static XMLStreamException |
unexpectedValue(XMLStreamReader reader,
Throwable t)
Get an exception reporting an unexpected XML element or attribute value. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MetaDataElementParser()
Method Detail |
---|
protected static XMLStreamException unexpectedValue(XMLStreamReader reader, Throwable t)
reader
- the stream reader
protected static XMLStreamException unexpectedElement(XMLStreamReader reader)
reader
- the stream reader
public static XMLStreamException unexpectedAttribute(XMLStreamReader reader, int index)
reader
- the stream readerindex
- the element index
protected static XMLStreamException missingRequired(XMLStreamReader reader, Set<?> required)
reader
- the stream readerrequired
- a set of enums whose toString method returns the attribute name
protected static XMLStreamException missingRequiredElement(XMLStreamReader reader, Set<?> required)
reader
- the stream readerrequired
- a set of enums whose toString method returns the attribute name
protected static void requireNoAttributes(XMLStreamReader reader) throws XMLStreamException
XMLStreamException
if one is found.
reader
- the reader
XMLStreamException
- if an error occursprotected static String getElementText(XMLStreamReader reader) throws XMLStreamException
reader
- the reader
XMLStreamException
- if an error occursprotected static String getElementText(XMLStreamReader reader, boolean trim) throws XMLStreamException
trim
value is true, then the text is trimmed
before returning.
reader
- trim
- True if the text has to be trimmed before returning. False otherwise
XMLStreamException
protected static void requireNoContent(XMLStreamReader reader) throws XMLStreamException
XMLStreamException
if it contains any child elements.
reader
- the reader
XMLStreamException
- if an error occursprotected static XMLStreamException duplicateNamedElement(XMLStreamReader reader, String name)
reader
- the stream readername
- the name that was redeclared
protected static boolean readBooleanAttributeElement(XMLStreamReader reader, String attributeName) throws XMLStreamException
reader
- the readerattributeName
- the attribute name, usually "value"
XMLStreamException
- if an error occurs or if the element does not
contain the specified attribute, contains other attributes,
or contains child elements.protected static String readStringAttributeElement(XMLStreamReader reader, String attributeName) throws XMLStreamException
reader
- the readerattributeName
- the attribute name, usually "value" or "name"
XMLStreamException
- if an error occurs or if the element does not
contain the specified attribute, contains other attributes,
or contains child elements.protected static String readSchemaLocation(XMLStreamReader reader) throws XMLStreamException
XMLStreamException
protected static String readDTDLocation(XMLStreamReader reader) throws XMLStreamException
XMLStreamException
protected static QName parseQName(XMLStreamReader reader, String qname)
protected static boolean attributeHasNamespace(XMLStreamReader reader, int i)
protected static <K,V> NavigableMap<K,V> safeCopyMap(NavigableMap<K,V> toCopy)
TreeMap
by passing the provided map to its constructor.
Thread safety note: toCopy
's monitor is held while the TreeMap
is being constructed.
K
- the type of toCopy
's keysV
- the type of toCopy
's valuestoCopy
- the map to copy. Cannot be null
public final boolean equals(Object obj)
equals
in class Object
obj
- the other object
true
if the objects are the samepublic final int hashCode()
hashCode
in class Object
|
JBoss Metadata Common 7.0.1.Final | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |