Class Record

    • Constructor Detail

      • Record

        public Record()
    • Method Detail

      • marshal

        public boolean marshal​(MarshallingContext context)
                        throws java.io.IOException
        Description copied from interface: Parser
        Marshals a record.
        Specified by:
        marshal in interface Parser
        Overrides:
        marshal in class Segment
        Parameters:
        context - the MarshallingContext
        Returns:
        whether a value was marshalled
        Throws:
        java.io.IOException - if an I/O error occurs
      • matchNext

        public Selector matchNext​(MarshallingContext context)
        Description copied from interface: Selector
        Finds a parser for marshalling a bean object. If matched by this Selector, the method should set the bean object on the property tree and return itself.
        Specified by:
        matchNext in interface Selector
        Parameters:
        context - the MarshallingContext
        Returns:
        the matched Selector for marshalling the bean object
      • close

        public Selector close​(ParsingContext context)
        Description copied from interface: Selector
        Checks for any unsatisfied components before the stream is closed.
        Specified by:
        close in interface Selector
        Parameters:
        context - the ParsingContext
        Returns:
        the first unsatisfied node
      • updateState

        public void updateState​(ParsingContext context,
                                java.lang.String namespace,
                                java.util.Map<java.lang.String,​java.lang.Object> state)
        Updates a Map with the current state of the Marshaller. Used for creating restartable Writers for Spring Batch.
        Specified by:
        updateState in interface Selector
        Parameters:
        namespace - a String to prefix all state keys with
        state - the Map to update with the latest state
        context - the ParsingContext
        Since:
        1.2
      • restoreState

        public void restoreState​(ParsingContext context,
                                 java.lang.String namespace,
                                 java.util.Map<java.lang.String,​java.lang.Object> state)
        Restores a Map of previously stored state information. Used for restarting XML writers from Spring Batch.
        Specified by:
        restoreState in interface Selector
        Parameters:
        namespace - a String to prefix all state keys with
        state - the Map containing the state to restore
        context - the ParsingContext
        Since:
        1.2
      • getKey

        protected java.lang.String getKey​(java.lang.String namespace,
                                          java.lang.String name)
        Returns a Map key for accessing state information for this Node.
        Parameters:
        namespace - the assigned namespace for the key
        name - the state information to access
        Returns:
        the fully qualified key
      • isRecordGroup

        public boolean isRecordGroup()
        Description copied from interface: Selector
        Returns whether this component is a record group.
        Specified by:
        isRecordGroup in interface Selector
        Returns:
        true if this component is a record group, false otherwise
      • getMinOccurs

        public int getMinOccurs()
        Description copied from interface: Selector
        Returns the minimum number of occurrences of this component (within the context of its parent).
        Specified by:
        getMinOccurs in interface Selector
        Returns:
        the minimum occurrences
      • setMinOccurs

        public void setMinOccurs​(int minOccurs)
      • getMaxOccurs

        public int getMaxOccurs()
        Description copied from interface: Selector
        Returns the maximum number of occurrences of this component (within the context of its parent).
        Specified by:
        getMaxOccurs in interface Selector
        Returns:
        the maximum occurrences
      • setMaxOccurs

        public void setMaxOccurs​(int maxOccurs)
      • getOrder

        public int getOrder()
        Description copied from interface: Selector
        Returns the order of this component (within the context of its parent).
        Specified by:
        getOrder in interface Selector
        Returns:
        the component order
      • setOrder

        public void setOrder​(int order)
      • getCount

        public int getCount​(ParsingContext context)
        Description copied from interface: Selector
        Returns the number of times this component was matched within the current iteration of its parent component.
        Specified by:
        getCount in interface Selector
        Parameters:
        context - the ParsingContext
        Returns:
        the match count
      • setCount

        public void setCount​(ParsingContext context,
                             int count)
        Description copied from interface: Selector
        Sets the number of times this component was matched within the current iteration of its parent component.
        Specified by:
        setCount in interface Selector
        Parameters:
        context - the ParsingContext
        count - the new match count
      • setFormat

        public void setFormat​(RecordFormat format)
      • registerLocals

        public void registerLocals​(java.util.Set<ParserLocal<?>> 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 Segment
        Parameters:
        locals - set of local variables
      • isMaxOccursReached

        public boolean isMaxOccursReached​(ParsingContext context)
        Description copied from interface: Selector
        Returns whether this component has reached its maximum occurrences.
        Specified by:
        isMaxOccursReached in interface Selector
        Parameters:
        context - the ParsingContext
        Returns:
        true if maximum occurrences has been reached
      • 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 Segment
        Parameters:
        s - the output to append