Class CollectionParser

    • Constructor Detail

      • CollectionParser

        public CollectionParser()
    • Method Detail

      • defines

        public boolean defines​(java.lang.Object value)
      • marshal

        protected boolean marshal​(MarshallingContext context,
                                  Parser delegate,
                                  int minOccurs,
                                  int maxOccurs)
                           throws java.io.IOException
        Specified by:
        marshal in class Aggregation
        Throws:
        java.io.IOException
      • isProperty

        public boolean isProperty()
        Returns whether this iteration is a property of a bean object.
        Specified by:
        isProperty in class Aggregation
        Returns:
        true if this iteration is a property, false otherwise
      • isInvalid

        protected boolean isInvalid​(ParsingContext context)
        Returns whether this iteration contained invalid values when last unmarshalled.
        Returns:
        true if this iteration contained invalid values
      • getCollection

        protected java.util.Collection<java.lang.Object> getCollection​(ParsingContext context)
        Returns the collection value being parsed.
        Returns:
        the Collection
      • length

        protected int length​(java.lang.Object value)
        Description copied from class: Aggregation
        Returns the length of aggregation.
        Specified by:
        length in class Aggregation
        Parameters:
        value - the aggregation value
        Returns:
        the length
      • setType

        public void setType​(java.lang.Class<?> collectionType)
      • getType

        public java.lang.Class<? extends java.util.Collection<java.lang.Object>> getType()
      • createValue

        public java.lang.Object createValue​(ParsingContext context)
        Description copied from interface: Property
        Creates the property value and returns it.
        Parameters:
        context - the ParsingContext
        Returns:
        the property value
      • createCollection

        protected java.util.Collection<java.lang.Object> createCollection()
      • getIterationSize

        public int getIterationSize()
        Description copied from interface: Iteration
        Returns the size of the components that make up a single iteration.
        Returns:
        the iteration size
      • registerLocals

        public void registerLocals​(java.util.Set<ParserLocal<? extends java.lang.Object>> locals)
        Description copied from class: Component
        Called by a stream to register variables stored in the parsing context. This method should be overridden by subclasses that need to register one or more parser context variables.
        Overrides:
        registerLocals in class Aggregation
        Parameters:
        locals - set of local variables
      • hasContent

        public boolean hasContent​(ParsingContext context)
        Description copied from interface: Parser
        Returns whether this parser or any of its descendant have content for marshalling.
        Specified by:
        hasContent in interface Parser
        Overrides:
        hasContent in class DelegatingParser
        Parameters:
        context - the ParsingContext
        Returns:
        true if there is content for marshalling, false otherwise
      • toParamString

        protected void toParamString​(java.lang.StringBuilder s)
        Description copied from class: TreeNode
        Called by TreeNode.toString() to append node parameters to the output.
        Overrides:
        toParamString in class Aggregation
        Parameters:
        s - the output to append