public class JaxbJdkXmlStructure extends DefaultJaxbXmlDocumentStructure
JaxbXmlDocumentStructure
for JAXB provider in JDK.
Note: If you're changing this class consider changing JaxbRiXmlStructure
as well.Constructor and Description |
---|
JaxbJdkXmlStructure(JAXBContext jaxbContext,
Class<?> expectedType,
boolean isReader) |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandleAttributes()
Returns
true if the implementation is capable of handling and providing information about attributes (#getExpectedAttributes and #getExpectedAttributesMap return valid results), false otherwise. |
void |
endElement(QName name)
Notifies this structure provider that an end element event has been fired and that the parent element of the one with
the given name should be processed.
|
Type |
getEntityType(QName entity,
boolean isAttribute)
Returns the
Type of entity (element, attribute) with the given name. |
Collection<QName> |
getExpectedAttributes()
Returns a collection of expected attributes of currently processed element.
|
Map<String,QName> |
getExpectedAttributesMap()
Returns a map of expected attributes of currently processed element where
key is represented by the local
name of the attribute and value is it's qualified name. |
Collection<QName> |
getExpectedElements()
Returns a collection of expected sub-elements of currently processed element.
|
Map<String,QName> |
getExpectedElementsMap()
Returns a map of expected sub-elements of currently processed element where
key is represented by the local
name of the sub-element and value is it's qualified name. |
Type |
getIndividualType()
Returns the
Type of individuals stored in an array/list. |
void |
handleAttribute(QName attributeName,
String value)
Notifies this structure provider about an attribute event with the given name has been fired and that this attribute
will be processed.
|
boolean |
hasSubElements()
Returns
true if JAXB bean of the currently processed element can contain any subelements. |
boolean |
isArrayCollection()
Returns
true if the currently processed element should represent an JSON array element. |
boolean |
isSameArrayCollection()
Returns
true if the currently processed element belongs to the same JSON array as the previous element. |
void |
startElement(QName name)
Notifies this structure provider that a start element event with the given name has been fired and that this element
will be processed.
|
getXmlDocumentStructure, qnameCollectionToMap
public JaxbJdkXmlStructure(JAXBContext jaxbContext, Class<?> expectedType, boolean isReader)
public Collection<QName> getExpectedElements()
JaxbXmlDocumentStructure
getExpectedElements
in interface JaxbXmlDocumentStructure
getExpectedElements
in class DefaultJaxbXmlDocumentStructure
public Collection<QName> getExpectedAttributes()
JaxbXmlDocumentStructure
getExpectedAttributes
in interface JaxbXmlDocumentStructure
getExpectedAttributes
in class DefaultJaxbXmlDocumentStructure
public Map<String,QName> getExpectedElementsMap()
JaxbXmlDocumentStructure
key
is represented by the local
name of the sub-element and value
is it's qualified name.getExpectedElementsMap
in interface JaxbXmlDocumentStructure
getExpectedElementsMap
in class DefaultJaxbXmlDocumentStructure
public Map<String,QName> getExpectedAttributesMap()
JaxbXmlDocumentStructure
key
is represented by the local
name of the attribute and value
is it's qualified name.getExpectedAttributesMap
in interface JaxbXmlDocumentStructure
getExpectedAttributesMap
in class DefaultJaxbXmlDocumentStructure
public boolean canHandleAttributes()
JaxbXmlDocumentStructure
true
if the implementation is capable of handling and providing information about attributes (#getExpectedAttributes
and #getExpectedAttributesMap
return valid results), false
otherwise.canHandleAttributes
in interface JaxbXmlDocumentStructure
canHandleAttributes
in class DefaultJaxbXmlDocumentStructure
true
if expected attributes can be obtained, false
otherwise.public Type getEntityType(QName entity, boolean isAttribute)
JaxbXmlDocumentStructure
Type
of entity (element, attribute) with the given name. The given entity name is expected to be either
name of the current element or name of it's direct child.getEntityType
in interface JaxbXmlDocumentStructure
getEntityType
in class DefaultJaxbXmlDocumentStructure
entity
- name of the entity to retrieve the Type
for.isAttribute
- flag whether the requested entity is an attribute or not.null
if the entity cannot be retrieved from the structure.public Type getIndividualType()
JaxbXmlDocumentStructure
Type
of individuals stored in an array/list.
Note: This method should be called only if an invocation of JaxbXmlDocumentStructure.getEntityType(javax.xml.namespace.QName, boolean)
returns a collection/array type.getIndividualType
in interface JaxbXmlDocumentStructure
getIndividualType
in class DefaultJaxbXmlDocumentStructure
null
if the entity cannot be retrieved from the structure.public void startElement(QName name)
JaxbXmlDocumentStructure
startElement
in interface JaxbXmlDocumentStructure
startElement
in class DefaultJaxbXmlDocumentStructure
name
- name of the element that will be processed.public void handleAttribute(QName attributeName, String value)
JaxbXmlDocumentStructure
handleAttribute
in interface JaxbXmlDocumentStructure
handleAttribute
in class DefaultJaxbXmlDocumentStructure
attributeName
- name of the attribute that will be processed.value
- value of the attribute.public boolean isArrayCollection()
JaxbXmlDocumentStructure
true
if the currently processed element should represent an JSON array element.isArrayCollection
in interface JaxbXmlDocumentStructure
isArrayCollection
in class DefaultJaxbXmlDocumentStructure
true
if the element is an JSON array element, false
otherwise.public boolean isSameArrayCollection()
JaxbXmlDocumentStructure
true
if the currently processed element belongs to the same JSON array as the previous element.isSameArrayCollection
in interface JaxbXmlDocumentStructure
isSameArrayCollection
in class DefaultJaxbXmlDocumentStructure
true
if the element is an JSON array belongs to the same JSON array as the previous element,
false
otherwise.public boolean hasSubElements()
JaxbXmlDocumentStructure
true
if JAXB bean of the currently processed element can contain any subelements.true
if JAXB bean of the currently processed element can contain any subelements,
false
otherwise.public void endElement(QName name)
JaxbXmlDocumentStructure
endElement
in interface JaxbXmlDocumentStructure
endElement
in class DefaultJaxbXmlDocumentStructure
name
- name of the ending element.Copyright © 2013 Oracle Corporation. All rights reserved.