org.jboss.metadata.parser.util
public class MetaDataElementParser extends Object implements XMLStreamConstants
Modifier and Type | Class and Description |
---|---|
static class |
MetaDataElementParser.DTDInfo |
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Constructor and Description |
---|
MetaDataElementParser() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected static String |
getElementText(XMLStreamReader reader,
boolean trim,
PropertyReplacer propertyReplacer)
Read the element text, with trimming and replace in properties.
|
protected static String |
getElementText(XMLStreamReader reader,
PropertyReplacer propertyReplacer)
Read the element text, with trimming and replace in properties.
|
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 <K,V> NavigableMap<K,V> |
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.
|
protected static XMLStreamException unexpectedValue(XMLStreamReader reader, Throwable t)
reader
- the stream readerprotected static XMLStreamException unexpectedElement(XMLStreamReader reader)
reader
- the stream readerpublic static XMLStreamException unexpectedAttribute(XMLStreamReader reader, int index)
reader
- the stream readerindex
- the element indexprotected static XMLStreamException missingRequired(XMLStreamReader reader, Set<?> required)
reader
- the stream readerrequired
- a set of enums whose toString method returns the attribute nameprotected static XMLStreamException missingRequiredElement(XMLStreamReader reader, Set<?> required)
reader
- the stream readerrequired
- a set of enums whose toString method returns the attribute nameprotected static void requireNoAttributes(XMLStreamReader reader) throws XMLStreamException
XMLStreamException
if one is found.reader
- the readerXMLStreamException
- if an error occursprotected static String getElementText(XMLStreamReader reader) throws XMLStreamException
reader
- the readerXMLStreamException
- if an error occursprotected static String getElementText(XMLStreamReader reader, PropertyReplacer propertyReplacer) throws XMLStreamException
reader
- the readerpropertyReplacer
- propertyReplacerXMLStreamException
- if an error occursprotected static String getElementText(XMLStreamReader reader, boolean trim, PropertyReplacer propertyReplacer) throws XMLStreamException
reader
- the readerpropertyReplacer
- propertyReplacertrim
- True if the text has to be trimmed before returning. False otherwiseXMLStreamException
- 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 otherwiseXMLStreamException
protected static void requireNoContent(XMLStreamReader reader) throws XMLStreamException
XMLStreamException
if it contains any child elements.reader
- the readerXMLStreamException
- if an error occursprotected static XMLStreamException duplicateNamedElement(XMLStreamReader reader, String name)
reader
- the stream readername
- the name that was redeclaredprotected 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)
Copyright © 2017 JBoss by Red Hat. All rights reserved.