Class StructureLoader
java.lang.Object
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.StructureLoader
Loads children of an element.
This loader works with a single JaxBeanInfo and handles
attributes, child elements, or child text.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
Fields inherited from class org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader
expectText -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchildElement(UnmarshallingContext.State state, TagName arg) Called when this loaderis an active loaderand we see a new child start tag.Returns a set of tag names expected as possible child elements in this context.Returns a set of tag names expected as possible child elements in this context.voidinit(JAXBContextImpl context, ClassBeanInfoImpl beanInfo, Accessor<?, Map<QName, String>> attWildcard) Completes the initialization.voidleaveElement(UnmarshallingContext.State state, TagName ea) Called when this loaderis an active loaderand we see an end tag.voidstartElement(UnmarshallingContext.State state, TagName ea) Called when the loader is activated, which is when a new start tag is seen and when the parent designated this loader as the child loader.voidtext(UnmarshallingContext.State state, CharSequence text) Called when this loaderis an active loaderand we see a chunk of text.Methods inherited from class org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.Loader
expectText, fireAfterUnmarshal, fireBeforeUnmarshal, handleGenericError, handleGenericException, handleGenericException, handleParseConversionException, reportError, reportError, reportUnexpectedChildElement
-
Constructor Details
-
StructureLoader
-
-
Method Details
-
init
public void init(JAXBContextImpl context, ClassBeanInfoImpl beanInfo, Accessor<?, Map<QName, String>> attWildcard) Completes the initialization.To fix the cyclic reference issue, the main part of the initialization needs to be done after a is set to
ClassBeanInfoImpl.loader. -
startElement
Description copied from class:LoaderCalled when the loader is activated, which is when a new start tag is seen and when the parent designated this loader as the child loader.The callee may change
state.loaderto designate another for the processing. It's the responsibility of the callee to forward the startElement event in such a case.- Overrides:
startElementin classLoaderea- info about the start tag. never null.- Throws:
SAXException
-
childElement
Description copied from class:LoaderCalled when this loaderis an active loaderand we see a new child start tag.The callee is expected to designate another loaderas a loaderthat processes this element, then it should also register a
Receiver. The designated loaderwill become an active loader.The default implementation reports an error saying an element is unexpected.
- Overrides:
childElementin classLoader- Throws:
SAXException
-
getExpectedChildElements
Description copied from class:LoaderReturns a set of tag names expected as possible child elements in this context.- Overrides:
getExpectedChildElementsin classLoader
-
getExpectedAttributes
Description copied from class:LoaderReturns a set of tag names expected as possible child elements in this context.- Overrides:
getExpectedAttributesin classLoader
-
text
Description copied from class:LoaderCalled when this loaderis an active loaderand we see a chunk of text. The runtime makes sure that adjacent characters (even those separated by comments, PIs, etc) are reported as one event. IOW, you won't see two text event calls in a row.- Overrides:
textin classLoader- Throws:
SAXException
-
leaveElement
Description copied from class:LoaderCalled when this loaderis an active loaderand we see an end tag.- Overrides:
leaveElementin classLoader- Throws:
SAXException
-
getBeanInfo
-