public class JaxbRiXmlStructure extends DefaultJaxbXmlDocumentStructure
JaxbXmlDocumentStructure for JAXB RI provider.
Note: If you're changing this class consider changing JaxbJdkXmlStructure as well.
| Constructor and Description |
|---|
JaxbRiXmlStructure(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, qnameCollectionToMappublic JaxbRiXmlStructure(JAXBContext jaxbContext, Class<?> expectedType, boolean isReader)
public Collection<QName> getExpectedElements()
JaxbXmlDocumentStructuregetExpectedElements in interface JaxbXmlDocumentStructuregetExpectedElements in class DefaultJaxbXmlDocumentStructurepublic Collection<QName> getExpectedAttributes()
JaxbXmlDocumentStructuregetExpectedAttributes in interface JaxbXmlDocumentStructuregetExpectedAttributes in class DefaultJaxbXmlDocumentStructurepublic Map<String,QName> getExpectedElementsMap()
JaxbXmlDocumentStructurekey is represented by the local
name of the sub-element and value is it's qualified name.getExpectedElementsMap in interface JaxbXmlDocumentStructuregetExpectedElementsMap in class DefaultJaxbXmlDocumentStructurepublic Map<String,QName> getExpectedAttributesMap()
JaxbXmlDocumentStructurekey is represented by the local
name of the attribute and value is it's qualified name.getExpectedAttributesMap in interface JaxbXmlDocumentStructuregetExpectedAttributesMap in class DefaultJaxbXmlDocumentStructurepublic boolean canHandleAttributes()
JaxbXmlDocumentStructuretrue if the implementation is capable of handling and providing information about attributes (#getExpectedAttributes and #getExpectedAttributesMap return valid results), false otherwise.canHandleAttributes in interface JaxbXmlDocumentStructurecanHandleAttributes in class DefaultJaxbXmlDocumentStructuretrue if expected attributes can be obtained, false otherwise.public Type getEntityType(QName entity, boolean isAttribute)
JaxbXmlDocumentStructureType 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 JaxbXmlDocumentStructuregetEntityType in class DefaultJaxbXmlDocumentStructureentity - 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()
JaxbXmlDocumentStructureType 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 JaxbXmlDocumentStructuregetIndividualType in class DefaultJaxbXmlDocumentStructurenull if the entity cannot be retrieved from the structure.public void startElement(QName name)
JaxbXmlDocumentStructurestartElement in interface JaxbXmlDocumentStructurestartElement in class DefaultJaxbXmlDocumentStructurename - name of the element that will be processed.public void handleAttribute(QName attributeName, String value)
JaxbXmlDocumentStructurehandleAttribute in interface JaxbXmlDocumentStructurehandleAttribute in class DefaultJaxbXmlDocumentStructureattributeName - name of the attribute that will be processed.value - value of the attribute.public boolean isArrayCollection()
JaxbXmlDocumentStructuretrue if the currently processed element should represent an JSON array element.isArrayCollection in interface JaxbXmlDocumentStructureisArrayCollection in class DefaultJaxbXmlDocumentStructuretrue if the element is an JSON array element, false otherwise.public boolean isSameArrayCollection()
JaxbXmlDocumentStructuretrue if the currently processed element belongs to the same JSON array as the previous element.isSameArrayCollection in interface JaxbXmlDocumentStructureisSameArrayCollection in class DefaultJaxbXmlDocumentStructuretrue if the element is an JSON array belongs to the same JSON array as the previous element,
false otherwise.public boolean hasSubElements()
JaxbXmlDocumentStructuretrue 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)
JaxbXmlDocumentStructureendElement in interface JaxbXmlDocumentStructureendElement in class DefaultJaxbXmlDocumentStructurename - name of the ending element.Copyright © 2022. All rights reserved.