Package uk.blankaspect.common.jsonxml
Enum Class ElementKind
- All Implemented Interfaces:
 Serializable,Comparable<ElementKind>,Constable
This is an enumeration of the kinds of element that may appear in a tree of JSON-XML.
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis class implements an unchecked exception that may be thrown if an XML element is encountered where a JSON-XML element is expected.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> - 
Enum Constant Summary
Enum Constants - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set<ElementKind> The kinds of element that correspond to compound JSON values.static final Set<ElementKind> The kinds of element that correspond to simple JSON values. - 
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturnstrueif the specified XML element matches any kind of JSON-XML element.createElement(IElementFacade elementFacade) Creates and returns a new instance of a JSON-XML element of this kind using the specified facade.booleanReturnstrueif this kind of JSON-XML element corresponds to a compound JSON value (array or object).static booleanisCompound(Element element) Returnstrueif the specified XML element matches a kind of JSON-XML element that corresponds to a compound JSON value (array or object).booleanisSimple()Returnstrueif this kind of JSON-XML element corresponds to a simple JSON value (null, Boolean, number or string).static booleanReturnstrueif the specified XML element matches a kind of JSON-XML element that corresponds to a simple JSON value (null, Boolean, number or string).key()Returns the key of this kind of JSON-XML element.booleanReturnstrueif the specified XML element matches this kind of JSON-XML element.static booleanmatches(Element element, Iterable<ElementKind> elementKinds) Returnstrueif the specified XML element matches one of the specified kinds of JSON-XML element.static booleanmatches(Element element, ElementKind... elementKinds) Returnstrueif the specified XML element matches one of the specified kinds of JSON-XML element.static ElementKindReturns the kind of JSON-XML element of the specified XML element.static ElementKindReturns the kind of JSON-XML element of the specified XML element.static ElementKindReturns the enum constant of this class with the specified name.static ElementKind[]values()Returns an array containing the constants of this enum class, in the order they are declared. 
- 
Enum Constant Details
- 
NULL
Corresponds to a JSON null value. - 
BOOLEAN
Corresponds to a JSON Boolean value. - 
NUMBER
Corresponds to a JSON number. - 
STRING
Corresponds to a JSON string. - 
ARRAY
Corresponds to a JSON array. - 
OBJECT
Corresponds to a JSON object. 
 - 
 - 
Field Details
- 
SIMPLE_KINDS
The kinds of element that correspond to simple JSON values. - 
COMPOUND_KINDS
The kinds of element that correspond to compound JSON values. 
 - 
 - 
Method Details
- 
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
 - an array containing the constants of this enum class, in the order they are declared
 
 - 
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
 name- the name of the enum constant to be returned.- Returns:
 - the enum constant with the specified name
 - Throws:
 IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
 - 
of
Returns the kind of JSON-XML element of the specified XML element.- Parameters:
 element- the XML element of interest.- Returns:
 - the kind of JSON-XML element of 
element, ornullif the element is not a JSON-XML element. 
 - 
ofThrow
Returns the kind of JSON-XML element of the specified XML element. An exception is thrown if the element is not a JSON-XML element.- Parameters:
 element- the XML element of interest.- Returns:
 - the kind of JSON-XML element of 
element. - Throws:
 ElementKind.UnexpectedKindException- ifelementis not a JSON-XML element.
 - 
matches
Returnstrueif the specified XML element matches one of the specified kinds of JSON-XML element.- Parameters:
 element- the XML element of interest.elementKinds- the kinds of JSON-XML element against whichelementwill be tested.- Returns:
 trueifelementmatches one ofelementKinds;falseotherwise.
 - 
matches
Returnstrueif the specified XML element matches one of the specified kinds of JSON-XML element.- Parameters:
 element- the XML element of interest.elementKinds- the kinds of JSON-XML element against whichelementwill be tested.- Returns:
 trueifelementmatches one ofelementKinds;falseotherwise.
 - 
anyMatch
Returnstrueif the specified XML element matches any kind of JSON-XML element.- Parameters:
 element- the XML element of interest.- Returns:
 trueifelementmatches any kind of JSON-XML element;falseotherwise.
 - 
isSimple
Returnstrueif the specified XML element matches a kind of JSON-XML element that corresponds to a simple JSON value (null, Boolean, number or string).- Parameters:
 element- the XML element of interest.- Returns:
 trueifelementmatches a kind of JSON-XML element that corresponds to a simple JSON value (null, Boolean, number or string);falseotherwise.
 - 
isCompound
Returnstrueif the specified XML element matches a kind of JSON-XML element that corresponds to a compound JSON value (array or object).- Parameters:
 element- the XML element of interest.- Returns:
 trueifelementmatches a kind of JSON-XML element that corresponds to a compound JSON value (array or object);falseotherwise.
 - 
key
Returns the key of this kind of JSON-XML element.- Returns:
 - the key of this kind of JSON-XML element.
 
 - 
isSimple
public boolean isSimple()Returnstrueif this kind of JSON-XML element corresponds to a simple JSON value (null, Boolean, number or string).- Returns:
 trueif this kind of JSON-XML element corresponds to a simple JSON value (null, Boolean, number or string);falseotherwise.
 - 
isCompound
public boolean isCompound()Returnstrueif this kind of JSON-XML element corresponds to a compound JSON value (array or object).- Returns:
 trueif this kind of JSON-XML element corresponds to a compound JSON value (array or object);falseotherwise.
 - 
matches
Returnstrueif the specified XML element matches this kind of JSON-XML element.- Parameters:
 element- the XML element of interest.- Returns:
 trueifelementmatches this kind of JSON-XML element;falseotherwise.
 - 
createElement
Creates and returns a new instance of a JSON-XML element of this kind using the specified facade.- Parameters:
 elementFacade- the facade through which the JSON-XML element will be created.- Returns:
 - a new instance of a JSON-XML element whose name is derived from the key of this kind of element.
 
 
 -