Class CompositeStructureBeanInfo

    • Constructor Detail

      • CompositeStructureBeanInfo

        public CompositeStructureBeanInfo​(JAXBContextImpl context)
    • Method Detail

      • createInstance

        public CompositeStructure createInstance​(UnmarshallingContext context)
                                          throws java.lang.IllegalAccessException,
                                                 java.lang.reflect.InvocationTargetException,
                                                 java.lang.InstantiationException,
                                                 org.xml.sax.SAXException
        Description copied from class: JaxBeanInfo
        Creates a new instance of the bean.

        This operation is only supported when JaxBeanInfo.isImmutable() is false.

        Specified by:
        createInstance in class JaxBeanInfo<CompositeStructure>
        Parameters:
        context - Sometimes the created bean remembers the corresponding source location,
        Throws:
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
        java.lang.InstantiationException
        org.xml.sax.SAXException
      • reset

        public boolean reset​(CompositeStructure o,
                             UnmarshallingContext context)
                      throws org.xml.sax.SAXException
        Description copied from class: JaxBeanInfo
        Resets the object to the initial state, as if the object is created fresh.

        This is used to reuse an existing object for unmarshalling.

        Specified by:
        reset in class JaxBeanInfo<CompositeStructure>
        context - used for reporting any errors.
        Returns:
        true if the object was successfuly resetted. False if the object is not resettable, in which case the object will be discarded and new one will be created.

        If the object is resettable but failed by an error, it should be reported to the context, then return false. If the object is not resettable to begin with, do not report an error.

        Throws:
        org.xml.sax.SAXException - as a result of reporting an error, the context may throw a SAXException.
      • getLoader

        public Loader getLoader​(JAXBContextImpl context,
                                boolean typeSubstitutionCapable)
        Description copied from class: JaxBeanInfo
        Gets the Loader that will unmarshall the given object.
        Specified by:
        getLoader in class JaxBeanInfo<CompositeStructure>
        Parameters:
        context - The JAXBContextImpl object that governs this object. This object is taken as a parameter so that JaxBeanInfo doesn't have to store them on its own. When this method is invoked from within the unmarshaller, tihs parameter can be null (because the loader is constructed already.)
        typeSubstitutionCapable - If true, the returned Loader is capable of recognizing @xsi:type (if necessary) and unmarshals a subtype. This allowes an optimization where this bean info is guaranteed not to have a type substitution. If false, the returned Loader doesn't look for @xsi:type.
        Returns:
        must return non-null valid object
      • serializeRoot

        public void serializeRoot​(CompositeStructure o,
                                  XMLSerializer target)
                           throws org.xml.sax.SAXException,
                                  java.io.IOException,
                                  javax.xml.stream.XMLStreamException
        Description copied from class: JaxBeanInfo
        Serializes the bean as the root element.

        In the java-to-schema binding, an object might marshal in two different ways depending on whether it is used as the root of the graph or not. In the former case, an object could marshal as an element, whereas in the latter case, it marshals as a type.

        This method is used to marshal the root of the object graph to allow this semantics to be implemented.

        It is doubtful to me if it's a good idea for an object to marshal in two ways depending on the context.

        For schema-to-java, this is equivalent to JaxBeanInfo.serializeBody(Object, XMLSerializer).

        Specified by:
        serializeRoot in class JaxBeanInfo<CompositeStructure>
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.stream.XMLStreamException
      • serializeAttributes

        public void serializeAttributes​(CompositeStructure o,
                                        XMLSerializer target)
                                 throws org.xml.sax.SAXException,
                                        java.io.IOException,
                                        javax.xml.stream.XMLStreamException
        Description copied from class: JaxBeanInfo
        Serializes attributes into the specified target.
        Specified by:
        serializeAttributes in class JaxBeanInfo<CompositeStructure>
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.stream.XMLStreamException
      • serializeBody

        public void serializeBody​(CompositeStructure o,
                                  XMLSerializer target)
                           throws org.xml.sax.SAXException,
                                  java.io.IOException,
                                  javax.xml.stream.XMLStreamException
        Description copied from class: JaxBeanInfo
        Serializes child elements and texts into the specified target.
        Specified by:
        serializeBody in class JaxBeanInfo<CompositeStructure>
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.stream.XMLStreamException