Class ParseUtils
java.lang.Object
org.infinispan.configuration.parsing.ParseUtils
- Author:
- David M. Lloyd
- 
Method SummaryModifier and TypeMethodDescriptionstatic CacheConfigurationExceptionattributeRemoved(ConfigurationReader reader, int attributeIndex) static CacheConfigurationExceptionattributeRemoved(ConfigurationReader reader, int attributeIndex, String newAttributeName) static ConfigurationReaderExceptionduplicateAttribute(ConfigurationReader reader, String name) Get an exception reporting that an attribute of a given name has already been declared in this scope.static ConfigurationReaderExceptionduplicateNamedElement(ConfigurationReader reader, String name) Get an exception reporting that an element of a given type and name has already been declared in this scope.static CacheConfigurationExceptionelementRemoved(ConfigurationReader reader) static CacheConfigurationExceptionelementRemoved(ConfigurationReader reader, String newElementName) static Namespace[]getNamespaceAnnotations(Class<?> cls) static voidignoreAttribute(ConfigurationReader reader, int attributeIndex) static voidignoreAttribute(ConfigurationReader reader, Enum<?> attribute) static voidignoreAttribute(ConfigurationReader reader, String attributeName) static voidignoreElement(ConfigurationReader reader, Enum<?> element) static voidintroducedFrom(ConfigurationReader reader, int major, int minor) static ConfigurationReaderExceptioninvalidAttributeValue(ConfigurationReader reader, int index) Get an exception reporting an invalid XML attribute value.static booleanisNoNamespaceAttribute(ConfigurationReader reader, int index) static ConfigurationReaderExceptionmissingRequired(ConfigurationReader reader, Set<?> required) Get an exception reporting a missing, required XML attribute.static ConfigurationReaderExceptionmissingRequiredElement(ConfigurationReader reader, Set<?> required) Get an exception reporting a missing, required XML child element.static ElementnextElement(ConfigurationReader reader) static voidparseAttributes(ConfigurationReader reader, Builder<?> builder) static booleanparseBoolean(ConfigurationReader reader, int i, String value) static <T extends Enum<T>>
 TparseEnum(ConfigurationReader reader, int i, Class<T> enumClass, String value) static IntegerparseInt(ConfigurationReader reader, int i, String value) static longparseLong(ConfigurationReader reader, int i, String value) static booleanreadBooleanAttributeElement(ConfigurationReader reader, String attributeName) Read an element which contains only a single boolean attribute.static StringreadStringAttributeElement(ConfigurationReader reader, String attributeName) Read an element which contains only a single string attribute.static voidremovedSince(ConfigurationReader reader, int major, int minor) static StringrequireAttributeProperty(ConfigurationReader reader, int i) static String[]requireAttributes(ConfigurationReader reader, boolean replace, String... attributeNames) Require all the named attributes, returning their values in order.static String[]requireAttributes(ConfigurationReader reader, Enum<?>... attributes) static String[]requireAttributes(ConfigurationReader reader, String... attributeNames) static voidChecks that the current element has no attributes, throwing anConfigurationReaderExceptionif one is found.static voidrequireNoContent(ConfigurationReader reader) Consumes the remainder of the current element, throwing anConfigurationReaderExceptionif it contains any child elements.static voidrequireNoNamespaceAttribute(ConfigurationReader reader, int index) static StringrequireSingleAttribute(ConfigurationReader reader, Enum<?> attribute) static StringrequireSingleAttribute(ConfigurationReader reader, String attributeName) Require that the current element have only a single attribute with the given name.static StringresolvePath(String path, String relativeTo) static ConfigurationReaderExceptionunexpectedAttribute(ConfigurationReader reader, int index) Get an exception reporting an unexpected XML attribute.static ConfigurationReaderExceptionunexpectedAttribute(ConfigurationReader reader, String name) Get an exception reporting an unexpected XML attribute.static ConfigurationReaderExceptionunexpectedElement(ConfigurationReader reader) Get an exception reporting an unexpected XML element.static ConfigurationReaderExceptionunexpectedElement(ConfigurationReader reader, String element) static <T extends Enum<T>>
 ConfigurationReaderExceptionunexpectedElement(ConfigurationReader reader, T element) static ConfigurationReaderExceptionGet an exception reporting an unexpected end tag for an XML element.
- 
Method Details- 
nextElement- Throws:
- ConfigurationReaderException
 
- 
unexpectedElementGet an exception reporting an unexpected XML element.- Parameters:
- reader- the stream reader
- Returns:
- the exception
 
- 
unexpectedElementpublic static <T extends Enum<T>> ConfigurationReaderException unexpectedElement(ConfigurationReader reader, T element) 
- 
unexpectedElementpublic static ConfigurationReaderException unexpectedElement(ConfigurationReader reader, String element) 
- 
unexpectedEndElementGet an exception reporting an unexpected end tag for an XML element.- Parameters:
- reader- the stream reader
- Returns:
- the exception
 
- 
unexpectedAttributepublic static ConfigurationReaderException unexpectedAttribute(ConfigurationReader reader, int index) Get an exception reporting an unexpected XML attribute.- Parameters:
- reader- the stream reader
- index- the attribute index
- Returns:
- the exception
 
- 
unexpectedAttributepublic static ConfigurationReaderException unexpectedAttribute(ConfigurationReader reader, String name) Get an exception reporting an unexpected XML attribute.- Parameters:
- reader- the stream reader
- name- the attribute name
- Returns:
- the exception
 
- 
invalidAttributeValuepublic static ConfigurationReaderException invalidAttributeValue(ConfigurationReader reader, int index) Get an exception reporting an invalid XML attribute value.- Parameters:
- reader- the stream reader
- index- the attribute index
- Returns:
- the exception
 
- 
missingRequiredpublic static ConfigurationReaderException missingRequired(ConfigurationReader reader, Set<?> required) Get an exception reporting a missing, required XML attribute.- Parameters:
- reader- the stream reader
- required- a set of enums whose toString method returns the attribute name
- Returns:
- the exception
 
- 
missingRequiredElementpublic static ConfigurationReaderException missingRequiredElement(ConfigurationReader reader, Set<?> required) Get an exception reporting a missing, required XML child element.- Parameters:
- reader- the stream reader
- required- a set of enums whose toString method returns the attribute name
- Returns:
- the exception
 
- 
requireNoAttributespublic static void requireNoAttributes(ConfigurationReader reader) throws ConfigurationReaderException Checks that the current element has no attributes, throwing anConfigurationReaderExceptionif one is found.- Parameters:
- reader- the reader
- Throws:
- ConfigurationReaderException- if an error occurs
 
- 
requireNoContentConsumes the remainder of the current element, throwing anConfigurationReaderExceptionif it contains any child elements.- Parameters:
- reader- the reader
- Throws:
- ConfigurationReaderException- if an error occurs
 
- 
duplicateAttributepublic static ConfigurationReaderException duplicateAttribute(ConfigurationReader reader, String name) Get an exception reporting that an attribute of a given name has already been declared in this scope.- Parameters:
- reader- the stream reader
- name- the name that was redeclared
- Returns:
- the exception
 
- 
duplicateNamedElementpublic static ConfigurationReaderException duplicateNamedElement(ConfigurationReader reader, String name) Get an exception reporting that an element of a given type and name has already been declared in this scope.- Parameters:
- reader- the stream reader
- name- the name that was redeclared
- Returns:
- the exception
 
- 
readBooleanAttributeElementpublic static boolean readBooleanAttributeElement(ConfigurationReader reader, String attributeName) throws ConfigurationReaderException Read an element which contains only a single boolean attribute.- Parameters:
- reader- the reader
- attributeName- the attribute name, usually "value"
- Returns:
- the boolean value
- Throws:
- ConfigurationReaderException- if an error occurs or if the element does not contain the specified attribute, contains other attributes, or contains child elements.
 
- 
readStringAttributeElementpublic static String readStringAttributeElement(ConfigurationReader reader, String attributeName) throws ConfigurationReaderException Read an element which contains only a single string attribute.- Parameters:
- reader- the reader
- attributeName- the attribute name, usually "value" or "name"
- Returns:
- the string value
- Throws:
- ConfigurationReaderException- if an error occurs or if the element does not contain the specified attribute, contains other attributes, or contains child elements.
 
- 
requireSingleAttributepublic static String requireSingleAttribute(ConfigurationReader reader, String attributeName) throws ConfigurationReaderException Require that the current element have only a single attribute with the given name.- Parameters:
- reader- the reader
- attributeName- the attribute name
- Throws:
- ConfigurationReaderException- if an error occurs
 
- 
requireSingleAttributepublic static String requireSingleAttribute(ConfigurationReader reader, Enum<?> attribute) throws ConfigurationReaderException - Throws:
- ConfigurationReaderException
 
- 
requireAttributespublic static String[] requireAttributes(ConfigurationReader reader, boolean replace, String... attributeNames) throws ConfigurationReaderException Require all the named attributes, returning their values in order.- Parameters:
- reader- the reader
- attributeNames- the attribute names
- Returns:
- the attribute values in order
- Throws:
- ConfigurationReaderException- if an error occurs
 
- 
requireAttributespublic static String[] requireAttributes(ConfigurationReader reader, String... attributeNames) throws ConfigurationReaderException - Throws:
- ConfigurationReaderException
 
- 
requireAttributespublic static String[] requireAttributes(ConfigurationReader reader, Enum<?>... attributes) throws ConfigurationReaderException - Throws:
- ConfigurationReaderException
 
- 
isNoNamespaceAttribute
- 
requireNoNamespaceAttributepublic static void requireNoNamespaceAttribute(ConfigurationReader reader, int index) throws ConfigurationReaderException - Throws:
- ConfigurationReaderException
 
- 
getNamespaceAnnotations
- 
resolvePath
- 
requireAttributePropertypublic static String requireAttributeProperty(ConfigurationReader reader, int i) throws ConfigurationReaderException - Throws:
- ConfigurationReaderException
 
- 
ignoreAttribute
- 
ignoreAttribute
- 
ignoreAttribute
- 
ignoreElement
- 
elementRemovedpublic static CacheConfigurationException elementRemoved(ConfigurationReader reader, String newElementName) 
- 
elementRemoved
- 
attributeRemovedpublic static CacheConfigurationException attributeRemoved(ConfigurationReader reader, int attributeIndex, String newAttributeName) 
- 
attributeRemovedpublic static CacheConfigurationException attributeRemoved(ConfigurationReader reader, int attributeIndex) 
- 
parseAttributes
- 
parseInt
- 
parseLong
- 
parseEnumpublic static <T extends Enum<T>> T parseEnum(ConfigurationReader reader, int i, Class<T> enumClass, String value) 
- 
parseBoolean
- 
introducedFrom
- 
removedSince
 
-