| 
 | BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.beanio.internal.util.TreeNode<Component>
org.beanio.internal.parser.Component
org.beanio.internal.parser.ParserComponent
org.beanio.internal.parser.format.xml.XmlSelectorWrapper
public class XmlSelectorWrapper
| Field Summary | 
|---|
| Fields inherited from interface org.beanio.internal.parser.Selector | 
|---|
| COUNT_KEY | 
| Fields inherited from interface org.beanio.internal.parser.format.xml.XmlNode | 
|---|
| XML_TYPE_ATTRIBUTE, XML_TYPE_ELEMENT, XML_TYPE_NONE, XML_TYPE_TEXT | 
| Constructor Summary | |
|---|---|
| XmlSelectorWrapper()Constructs a new XmlSelectorWrapper. | |
| Method Summary | |
|---|---|
|  void | clearValue(ParsingContext context)Clears the current property value. | 
|  Selector | close(ParsingContext context)Checks for any unsatisfied components before the stream is closed. | 
|  Document | createBaseDocument()Creates a DOM made up of all XmlSelectorWrapper descendants that wrap a group or record. | 
|  int | getCount(ParsingContext context)Returns the number of times this component was matched within the current iteration of its parent component. | 
|  int | getDepth() | 
| protected  String | getKey(String namespace,
       String name)Returns a Map key for accessing state information for this Node. | 
|  String | getLocalName()Returns the XML local name for this node. | 
|  int | getMaxOccurs()Returns the maximum number of occurrences of this component (within the context of its parent). | 
|  int | getMinOccurs()Returns the minimum number of occurrences of this component (within the context of its parent). | 
|  String | getNamespace()Returns the namespace of this node. | 
|  int | getOrder()Returns the order of this component (within the context of its parent). | 
|  String | getPrefix()Returns the namespace prefix for marshaling this node, or null if the namespace should override the default namespace. | 
|  Property | getProperty()Returns the Propertymapped to this component, or null if there is
 no property mapping. | 
|  int | getSize()Returns the size of a single occurrence of this element, which is used to offset field positions for repeating segments and fields. | 
|  int | getType()Returns the XML node type. | 
|  Object | getValue(ParsingContext context)Returns the unmarshalled property value. | 
|  boolean | hasContent(ParsingContext context)Returns whether this parser or any of its descendant have content for marshalling. | 
|  boolean | isGroup() | 
|  boolean | isIdentifier()Returns whether this parser or any descendant of this parser is used to identify a record during unmarshalling. | 
|  boolean | isLazy()Returns whether this node must exist during unmarshalling. | 
|  boolean | isMaxOccursReached(ParsingContext context)Returns whether this component has reached its maximum occurrences. | 
|  boolean | isNamespaceAware()Returns true if a namespace was configured for this node, and is therefore used to unmarshal and marshal the node. | 
|  boolean | isNillable()Returns whether this node is nillable. | 
|  boolean | isRecordGroup()Returns whether this component is a record group. | 
|  boolean | isRepeating()Returns whether this node may repeat in the context of its immediate parent. | 
|  boolean | marshal(MarshallingContext context)Marshals a record. | 
|  Selector | matchAny(UnmarshallingContext context)Finds a parser that matches the input record. | 
|  boolean | matches(UnmarshallingContext context)Returns whether this parser and its children match a record being unmarshalled. | 
|  Selector | matchNext(MarshallingContext context)Finds a parser for marshalling a bean object. | 
|  Selector | matchNext(UnmarshallingContext context)Finds a parser for unmarshalling a record based on the current state of the stream. | 
|  void | registerLocals(Set<ParserLocal<?>> locals)Called by a stream to register variables stored in the parsing context. | 
|  void | reset(ParsingContext context)Resets the component count of this Selector's children. | 
|  void | restoreState(ParsingContext context,
             String namespace,
             Map<String,Object> state)Restores a Map of previously stored state information. | 
|  void | setCount(ParsingContext context,
         int count)Sets the number of times this component was matched within the current iteration of its parent component. | 
|  void | setDepth(int depth) | 
|  void | setGroup(boolean group) | 
|  void | setLocalName(String localName) | 
|  void | setNamespace(String namespace) | 
|  void | setNamespaceAware(boolean namespaceAware) | 
|  void | setPrefix(String prefix) | 
|  void | setValue(ParsingContext context,
         Object value)Sets the property value for marshaling. | 
|  void | skip(UnmarshallingContext context)Skips a record or group of records. | 
| protected  void | toParamString(StringBuilder s)Called by TreeNode.toString()to append node parameters to the output. | 
|  boolean | unmarshal(UnmarshallingContext context)Unmarshals a record. | 
|  void | updateState(ParsingContext context,
            String namespace,
            Map<String,Object> state)Updates a Map with the current state of the Marshaller. | 
| Methods inherited from class org.beanio.internal.parser.ParserComponent | 
|---|
| isSupportedChild | 
| Methods inherited from class org.beanio.internal.util.TreeNode | 
|---|
| add, clone, find, getChildren, getFirst, getName, iterator, print, setName, size, sort, toString, updateReferences | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Methods inherited from interface org.beanio.internal.parser.Parser | 
|---|
| getName | 
| Constructor Detail | 
|---|
public XmlSelectorWrapper()
| Method Detail | 
|---|
public Document createBaseDocument()
Document
public boolean marshal(MarshallingContext context)
                throws IOException
Parser
marshal in interface Parsercontext - the MarshallingContext
IOException - if an I/O error occurspublic boolean unmarshal(UnmarshallingContext context)
Parser
unmarshal in interface Parsercontext - the UnmarshallingContext
public void skip(UnmarshallingContext context)
Selector
skip in interface Selectorcontext - the UnmarshallingContextpublic Selector matchNext(MarshallingContext context)
Selector
matchNext in interface Selectorcontext - the MarshallingContext
Selector for marshalling the bean objectpublic Selector matchNext(UnmarshallingContext context)
Selector
matchNext in interface Selectorcontext - the UnmarshallingContext
Selector for unmarshalling the recordpublic Selector matchAny(UnmarshallingContext context)
SelectorSelector.matchNext(UnmarshallingContext) returns null, in order to differentiate
 between unexpected and unidentified record types.
matchAny in interface Selectorcontext - the UnmarshallingContext
Selectorpublic boolean matches(UnmarshallingContext context)
Parser
matches in interface Parsercontext - the UnmarshallingContext
public void updateState(ParsingContext context,
                        String namespace,
                        Map<String,Object> state)
updateState in interface Selectornamespace - a String to prefix all state keys withstate - the Map to update with the latest statecontext - the ParsingContext
public void restoreState(ParsingContext context,
                         String namespace,
                         Map<String,Object> state)
restoreState in interface Selectornamespace - a String to prefix all state keys withstate - the Map containing the state to restorecontext - the ParsingContext
protected String getKey(String namespace,
                        String name)
namespace - the assigned namespace for the keyname - the state information to access
public Object getValue(ParsingContext context)
Parser
getValue in interface Parsercontext - the ParsingContext
public void setValue(ParsingContext context,
                     Object value)
Parser
setValue in interface Parsercontext - the ParsingContextvalue - the property valuepublic int getSize()
ParserThe concept of size is dependent on the stream format. The size of an element in a fixed length stream format is determined by the length of the element in characters, while other stream formats calculate size based on the number of fields. Some stream formats, such as XML, may ignore size settings.
getSize in interface Parserpublic Selector close(ParsingContext context)
Selector
close in interface Selectorcontext - the ParsingContext
public void reset(ParsingContext context)
Selector
reset in interface Selectorcontext - the ParsingContextpublic int getCount(ParsingContext context)
Selector
getCount in interface Selectorcontext - the ParsingContext
public void setCount(ParsingContext context,
                     int count)
Selector
setCount in interface Selectorcontext - the ParsingContextcount - the new match countpublic int getMinOccurs()
Selector
getMinOccurs in interface Selectorpublic int getMaxOccurs()
Selector
getMaxOccurs in interface Selectorpublic int getOrder()
Selector
getOrder in interface Selectorpublic boolean isMaxOccursReached(ParsingContext context)
Selector
isMaxOccursReached in interface Selectorcontext - the ParsingContext
public void clearValue(ParsingContext context)
Parser
clearValue in interface Parsercontext - the ParsingContextpublic boolean isIdentifier()
Parser
isIdentifier in interface Parserpublic boolean isGroup()
public void setGroup(boolean group)
public boolean isLazy()
Parser
isLazy in interface Parserpublic String getLocalName()
XmlNode
getLocalName in interface XmlNodepublic void setLocalName(String localName)
public String getNamespace()
XmlNode
getNamespace in interface XmlNodepublic void setNamespace(String namespace)
namespace - public String getPrefix()
XmlNode
getPrefix in interface XmlNodepublic void setPrefix(String prefix)
prefix - public boolean isNamespaceAware()
XmlNode
isNamespaceAware in interface XmlNodepublic void setNamespaceAware(boolean namespaceAware)
namespaceAware - public int getType()
XmlNode
getType in interface XmlNodeXmlNode.XML_TYPE_NONE,
   XmlNode.XML_TYPE_ELEMENT,
   XmlNode.XML_TYPE_ATTRIBUTE, or
   XmlNode.XML_TYPE_TEXTpublic boolean isNillable()
XmlNode
isNillable in interface XmlNodepublic boolean isRepeating()
XmlNode
isRepeating in interface XmlNodepublic Property getProperty()
SelectorProperty mapped to this component, or null if there is
 no property mapping.
getProperty in interface SelectorProperty mapped to this componentpublic boolean hasContent(ParsingContext context)
Parser
hasContent in interface Parsercontext - the ParsingContext
public boolean isRecordGroup()
Selector
isRecordGroup in interface Selectorpublic int getDepth()
public void setDepth(int depth)
public void registerLocals(Set<ParserLocal<?>> locals)
Component
registerLocals in class Componentlocals - set of local variablesprotected void toParamString(StringBuilder s)
TreeNodeTreeNode.toString() to append node parameters to the output.
toParamString in class TreeNode<Component>s - the output to append| 
 | BeanIO 2.0.4 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||