Package org.wildfly.client.config
Interface ConfigurationXMLStreamReader
- All Superinterfaces:
AutoCloseable,XMLStreamConstants,XMLStreamReader
- Author:
- David M. Lloyd
-
Field Summary
FieldsFields 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 -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanattributeNamespaceEquals(int idx, String uri) Determine whether the current element has an attribute at the given index with a namespace URI equal to the given value.voidclose()static StringeventToString(int type) getAttributeValue(int index) Get the value of an attribute.default StringgetAttributeValueResolved(int index) Get the value of an attribute with expressions resolved.default booleangetBooleanAttributeValue(int index) Get an attribute value as aboolean.default booleangetBooleanAttributeValueResolved(int index) Get an attribute value as abooleanwith expressions resolved.default CidrAddressgetCidrAddressAttributeValue(int index) Get an attribute value as aCidrAddress.default CidrAddressgetCidrAddressAttributeValueResolved(int index) Get an attribute value as aCidrAddresswith expressions resolved.default ExpressiongetElementExpression(Expression.Flag... flags) Get the element text content as an expression.default Stringdefault ExpressiongetExpressionAttributeValue(int index, Expression.Flag... flags) Get an attribute value as a compiledExpression.default InetAddressgetInetAddressAttributeValue(int index) Get an attribute value as aInetAddress.default InetAddressgetInetAddressAttributeValueResolved(int index) Get an attribute value as aInetAddresswith expressions resolved.default intgetIntAttributeValue(int index) Get the value of an attribute as an integer.default intgetIntAttributeValue(int index, int minValue, int maxValue) Get the value of an attribute as an integer.default intgetIntAttributeValueResolved(int index) Get the value of an attribute as an integer with expressions resolved.default intgetIntAttributeValueResolved(int index, int minValue, int maxValue) Get the value of an attribute as an integer with expressions resolved.default int[]getIntListAttributeValue(int index) Get the value of an attribute as an integer list.default int[]getIntListAttributeValueResolved(int index) Get the value of an attribute as an integer list with expressions resolved.getListAttributeValue(int index) Get the value of an attribute as a space-delimited string list.default String[]getListAttributeValueAsArray(int index) Get the value of an attribute as a space-delimited string list, as an array.default String[]getListAttributeValueAsArrayResolved(int index) Get the value of an attribute as a space-delimited string list with expressions resolved, as an array.getListAttributeValueAsIterator(int index) Get the value of an attribute as a space-delimited string list, as an iterator.getListAttributeValueAsIteratorResolved(int index) /** Get the value of an attribute as a space-delimited string list with expressions resolved, as an iterator.getListAttributeValueResolved(int index) Get the value of an attribute as a space-delimited string list with expressions resolved.default longgetLongAttributeValue(int index) Get the value of an attribute as a long.default longgetLongAttributeValue(int index, long minValue, long maxValue) Get the value of an attribute as a long.default longgetLongAttributeValueResolved(int index) Get the value of an attribute as a long with expressions resolved.default longgetLongAttributeValueResolved(int index, long minValue, long maxValue) Get the value of an attribute as a long with expressions resolved.default long[]getLongListAttributeValue(int index) Get the value of an attribute as a long integer list.default long[]getLongListAttributeValueResolved(int index) Get the value of an attribute as a long integer list with expressions resolved.default ObjectgetProperty(String name) intgetTextCharacters(int sourceStart, char[] target, int targetStart, int length) getUri()default URIgetURIAttributeValue(int index) Get an attribute value as aURI.default URIgetURIAttributeValueResolved(int index) Get an attribute value as aURIwith expressions resolved.default booleanhasAttributeNamespace(int idx) Determine whether the current element has an attribute at the given index with a non-empty namespace URI.default booleanhasName()default booleanDetermine whether the current element has a non-empty namespace URI.booleanhasNext()default booleanhasText()default booleandefault booleandefault booleandefault booleandefault booleandefault ConfigXMLParseExceptionmissingRequiredAttribute(String namespaceUri, String localName) Return a throwable exception explaining that a required attribute with the given namespace and local name was missing.default ConfigXMLParseExceptionmissingRequiredElement(String namespaceUri, String localName) Return a throwable exception explaining that a required element with the given namespace and local name was missing.default booleannamespaceURIEquals(String uri) Determine whether the current element has a namespace URI equal to the given value.intnext()default intnextTag()default ConfigXMLParseExceptionnumericAttributeValueOutOfRange(int index, long minValue, long maxValue) Return a throwable exception explaining that a numeric attribute at the given index was out of its required range.default voiddefault voiddefault booleandefault ConfigXMLParseExceptionunexpectedAttribute(int i) Return a throwable exception explaining that the attribute at the current position with the given index was not expected.default ConfigXMLParseExceptionReturn a throwable exception explaining that some unexpected content was encountered.default ConfigXMLParseExceptionReturn a throwable exception explaining that the document end was reached unexpectedly.default ConfigXMLParseExceptionReturn a throwable exception explaining that the element at the current position was not expected.Methods inherited from interface javax.xml.stream.XMLStreamReader
getAttributeCount, getAttributeLocalName, getAttributeName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getCharacterEncodingScheme, getEncoding, getEventType, getLocalName, getName, getNamespaceContext, getNamespaceCount, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getNamespaceURI, getPIData, getPITarget, getPrefix, getText, getTextCharacters, getTextLength, getTextStart, getVersion, isAttributeSpecified
-
Field Details
-
EMPTY_CHARS
static final char[] EMPTY_CHARS
-
-
Method Details
-
getUri
URI getUri() -
getXmlInputFactory
XMLInputFactory getXmlInputFactory() -
getIncludedFrom
XMLLocation getIncludedFrom() -
hasNext
- Specified by:
hasNextin interfaceXMLStreamReader- Throws:
ConfigXMLParseException
-
next
- Specified by:
nextin interfaceXMLStreamReader- Throws:
ConfigXMLParseException
-
hasNamespace
default boolean hasNamespace()Determine whether the current element has a non-empty namespace URI.- Returns:
trueif the element has a non-empty namespace URI,falseotherwise
-
namespaceURIEquals
Determine whether the current element has a namespace URI equal to the given value. If the given value isnullor empty, this method returnstrueonly if the current element has no namespace.- Parameters:
uri- the namespace URI to test- Returns:
trueif the element has a namespace URI equal to the argument, or the argument isnullor empty and the element has no namespace, orfalseotherwise
-
hasAttributeNamespace
default boolean hasAttributeNamespace(int idx) Determine whether the current element has an attribute at the given index with a non-empty namespace URI.- Parameters:
idx- the attribute index- Returns:
trueif the attribute has a non-empty namespace URI,falseotherwise
-
attributeNamespaceEquals
Determine whether the current element has an attribute at the given index with a namespace URI equal to the given value. If the given value isnullor empty, this method returnstrueonly if the attribute has no namespace.- Parameters:
idx- the attribute indexuri- the namespace URI to test- Returns:
trueif the attribute has a namespace URI equal to the argument, or the argument isnullor empty and the element has no namespace, orfalseotherwise
-
nextTag
- Specified by:
nextTagin interfaceXMLStreamReader- Throws:
ConfigXMLParseException
-
getElementText
- Specified by:
getElementTextin interfaceXMLStreamReader- Throws:
ConfigXMLParseException
-
getElementExpression
Get the element text content as an expression.- Parameters:
flags- the expression compilation flags- Returns:
- the expression (not
null) - Throws:
ConfigXMLParseException- if the value is not a valid expression by the given flags
-
require
default void require(int type, String namespaceURI, String localName) throws ConfigXMLParseException - Specified by:
requirein interfaceXMLStreamReader- Throws:
ConfigXMLParseException
-
isStartElement
default boolean isStartElement()- Specified by:
isStartElementin interfaceXMLStreamReader
-
isEndElement
default boolean isEndElement()- Specified by:
isEndElementin interfaceXMLStreamReader
-
isCharacters
default boolean isCharacters()- Specified by:
isCharactersin interfaceXMLStreamReader
-
isWhiteSpace
default boolean isWhiteSpace()- Specified by:
isWhiteSpacein interfaceXMLStreamReader
-
eventToString
-
getProperty
- Specified by:
getPropertyin interfaceXMLStreamReader- Throws:
IllegalArgumentException
-
hasText
default boolean hasText()- Specified by:
hasTextin interfaceXMLStreamReader
-
isStandalone
default boolean isStandalone()- Specified by:
isStandalonein interfaceXMLStreamReader
-
standaloneSet
default boolean standaloneSet()- Specified by:
standaloneSetin interfaceXMLStreamReader
-
hasName
default boolean hasName()- Specified by:
hasNamein interfaceXMLStreamReader
-
getLocation
XMLLocation getLocation()- Specified by:
getLocationin interfaceXMLStreamReader
-
getTextCharacters
int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws ConfigXMLParseException - Specified by:
getTextCharactersin interfaceXMLStreamReader- Throws:
ConfigXMLParseException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceXMLStreamReader- Throws:
ConfigXMLParseException
-
skipContent
- Throws:
ConfigXMLParseException
-
unexpectedElement
Return a throwable exception explaining that the element at the current position was not expected.- Returns:
- the exception
-
unexpectedAttribute
Return a throwable exception explaining that the attribute at the current position with the given index was not expected.- Parameters:
i- the attribute index- Returns:
- the exception
-
unexpectedDocumentEnd
Return a throwable exception explaining that the document end was reached unexpectedly.- Returns:
- the exception
-
unexpectedContent
Return a throwable exception explaining that some unexpected content was encountered.- Returns:
- the exception
-
missingRequiredElement
Return a throwable exception explaining that a required element with the given namespace and local name was missing.- Parameters:
namespaceUri- the namespace URIlocalName- the local element name- Returns:
- the exception
-
missingRequiredAttribute
Return a throwable exception explaining that a required attribute with the given namespace and local name was missing.- Parameters:
namespaceUri- the namespace URI (ornullif it is a local name)localName- the local attribute name- Returns:
- the exception
-
numericAttributeValueOutOfRange
default ConfigXMLParseException numericAttributeValueOutOfRange(int index, long minValue, long maxValue) Return a throwable exception explaining that a numeric attribute at the given index was out of its required range.- Parameters:
index- the attribute indexminValue- the minimum attribute valuemaxValue- the maximum attribute value- Returns:
- the exception
-
getAttributeValue
Get the value of an attribute.- Specified by:
getAttributeValuein interfaceXMLStreamReader- Parameters:
index- the index of the attribute- Returns:
- the attribute value
-
getAttributeValueResolved
Get the value of an attribute with expressions resolved.- Parameters:
index- the index of the attribute- Returns:
- the attribute value
- Throws:
ConfigXMLParseException- if an error occurs
-
getIntAttributeValue
Get the value of an attribute as an integer.- Parameters:
index- the index of the attribute- Returns:
- the integer value
- Throws:
ConfigXMLParseException- if an error occurs
-
getIntAttributeValueResolved
Get the value of an attribute as an integer with expressions resolved.- Parameters:
index- the index of the attribute- Returns:
- the integer value
- Throws:
ConfigXMLParseException- if an error occurs
-
getIntAttributeValue
default int getIntAttributeValue(int index, int minValue, int maxValue) throws ConfigXMLParseException Get the value of an attribute as an integer.- Parameters:
index- the index of the attributeminValue- the minimum allowed valuemaxValue- the maximum allowed value- Returns:
- the integer value
- Throws:
ConfigXMLParseException- if an error occurs
-
getIntAttributeValueResolved
default int getIntAttributeValueResolved(int index, int minValue, int maxValue) throws ConfigXMLParseException Get the value of an attribute as an integer with expressions resolved.- Parameters:
index- the index of the attributeminValue- the minimum allowed valuemaxValue- the maximum allowed value- Returns:
- the integer value
- Throws:
ConfigXMLParseException- if an error occurs
-
getIntListAttributeValue
Get the value of an attribute as an integer list.- Parameters:
index- the index of the attribute- Returns:
- the integer values
- Throws:
ConfigXMLParseException- if an error occurs
-
getIntListAttributeValueResolved
Get the value of an attribute as an integer list with expressions resolved.- Parameters:
index- the index of the attribute- Returns:
- the integer values
- Throws:
ConfigXMLParseException- if an error occurs
-
getListAttributeValueAsIterator
Get the value of an attribute as a space-delimited string list, as an iterator.- Parameters:
index- the index of the attribute- Returns:
- the values
- Throws:
ConfigXMLParseException- if an error occurs
-
getListAttributeValueAsIteratorResolved
default Iterator<String> getListAttributeValueAsIteratorResolved(int index) throws ConfigXMLParseException /** Get the value of an attribute as a space-delimited string list with expressions resolved, as an iterator.- Parameters:
index- the index of the attribute- Returns:
- the values
- Throws:
ConfigXMLParseException- if an error occurs
-
getListAttributeValue
Get the value of an attribute as a space-delimited string list.- Parameters:
index- the index of the attribute- Returns:
- the values
- Throws:
ConfigXMLParseException- if an error occurs
-
getListAttributeValueResolved
Get the value of an attribute as a space-delimited string list with expressions resolved.- Parameters:
index- the index of the attribute- Returns:
- the values
- Throws:
ConfigXMLParseException- if an error occurs
-
getListAttributeValueAsArray
Get the value of an attribute as a space-delimited string list, as an array.- Parameters:
index- the index of the attribute- Returns:
- the values
- Throws:
ConfigXMLParseException- if an error occurs
-
getListAttributeValueAsArrayResolved
Get the value of an attribute as a space-delimited string list with expressions resolved, as an array.- Parameters:
index- the index of the attribute- Returns:
- the values
- Throws:
ConfigXMLParseException- if an error occurs
-
getLongAttributeValue
Get the value of an attribute as a long.- Parameters:
index- the index of the attribute- Returns:
- the long value
- Throws:
ConfigXMLParseException- if an error occurs
-
getLongAttributeValueResolved
Get the value of an attribute as a long with expressions resolved.- Parameters:
index- the index of the attribute- Returns:
- the long value
- Throws:
ConfigXMLParseException- if an error occurs
-
getLongAttributeValue
default long getLongAttributeValue(int index, long minValue, long maxValue) throws ConfigXMLParseException Get the value of an attribute as a long.- Parameters:
index- the index of the attributeminValue- the minimum allowed valuemaxValue- the maximum allowed value- Returns:
- the long value
- Throws:
ConfigXMLParseException- if an error occurs
-
getLongAttributeValueResolved
default long getLongAttributeValueResolved(int index, long minValue, long maxValue) throws ConfigXMLParseException Get the value of an attribute as a long with expressions resolved.- Parameters:
index- the index of the attributeminValue- the minimum allowed valuemaxValue- the maximum allowed value- Returns:
- the long value
- Throws:
ConfigXMLParseException- if an error occurs
-
getLongListAttributeValue
Get the value of an attribute as a long integer list.- Parameters:
index- the index of the attribute- Returns:
- the long values
- Throws:
ConfigXMLParseException- if an error occurs
-
getLongListAttributeValueResolved
Get the value of an attribute as a long integer list with expressions resolved.- Parameters:
index- the index of the attribute- Returns:
- the long values
- Throws:
ConfigXMLParseException- if an error occurs
-
getBooleanAttributeValue
default boolean getBooleanAttributeValue(int index) Get an attribute value as aboolean. Only the string"true"(case-insensitive) is recognized as atruevalue; all other strings are consideredfalse.- Parameters:
index- the attribute index- Returns:
- the attribute value
-
getBooleanAttributeValueResolved
Get an attribute value as abooleanwith expressions resolved. Only the string"true"(case-insensitive) is recognized as atruevalue; all other strings are consideredfalse.- Parameters:
index- the attribute index- Returns:
- the attribute value
- Throws:
ConfigXMLParseException- if an error occurs
-
getURIAttributeValue
Get an attribute value as aURI.- Parameters:
index- the attribute index- Returns:
- the attribute value
- Throws:
ConfigXMLParseException- if the value is not a valid URI
-
getURIAttributeValueResolved
Get an attribute value as aURIwith expressions resolved.- Parameters:
index- the attribute index- Returns:
- the attribute value
- Throws:
ConfigXMLParseException- if the value is not a valid URI
-
getExpressionAttributeValue
default Expression getExpressionAttributeValue(int index, Expression.Flag... flags) throws ConfigXMLParseException Get an attribute value as a compiledExpression.- Parameters:
index- the attribute indexflags- the expression compilation flags- Returns:
- the expression, or
nullif the attribute is not present - Throws:
ConfigXMLParseException- if the value is not a valid expression by the given flags
-
getInetAddressAttributeValue
Get an attribute value as aInetAddress.- Parameters:
index- the attribute index- Returns:
- the attribute value
- Throws:
ConfigXMLParseException- if the value is not a valid IP address
-
getInetAddressAttributeValueResolved
Get an attribute value as aInetAddresswith expressions resolved.- Parameters:
index- the attribute index- Returns:
- the attribute value
- Throws:
ConfigXMLParseException- if the value is not a valid IP address
-
getCidrAddressAttributeValue
Get an attribute value as aCidrAddress.- Parameters:
index- the attribute index- Returns:
- the attribute value
- Throws:
ConfigXMLParseException- if the value is not a valid IP address
-
getCidrAddressAttributeValueResolved
Get an attribute value as aCidrAddresswith expressions resolved.- Parameters:
index- the attribute index- Returns:
- the attribute value
- Throws:
ConfigXMLParseException- if the value is not a valid IP address
-