| java.lang.Object org.jibx.runtime.impl.UnmarshallingContext
UnmarshallingContext | public class UnmarshallingContext implements IUnmarshallingContext(Code) | | Pull parser wrapper supplying convenience methods for access. Most of
these methods are designed for use in code generated by the binding
generator.
author: Dennis M. Sosnoski |
Method Summary | |
public String | accumulateText() Accumulate text content. | public void | addUnmarshalling(int index, String ns, String name, String cname) Define unmarshalling for element. | public boolean | attributeBoolean(String ns, String name) Get boolean value of attribute from current start tag. | public boolean | attributeBoolean(String ns, String name, boolean dflt) Get boolean value of optional attribute from current start tag. | public byte | attributeByte(String ns, String name) Get byte value of attribute from current start tag. | public byte | attributeByte(String ns, String name, byte dflt) Get byte value of optional attribute from current start tag. | public char | attributeChar(String ns, String name) Get char value of attribute from current start tag. | public char | attributeChar(String ns, String name, char dflt) Get char value of optional attribute from current start tag. | public Date | attributeDate(String ns, String name) Get java.util.Date value of attribute from current start
tag. | public Date | attributeDate(String ns, String name, Date dflt) Get java.util.Date value of optional attribute from current
start tag. | public double | attributeDouble(String ns, String name) Get double value of attribute from current start tag. | public double | attributeDouble(String ns, String name, double dflt) Get double value of optional attribute from current start tag. | public int | attributeEnumeration(String ns, String name, String[] enums, int[] vals) Get enumeration attribute value from current start tag. | public int | attributeEnumeration(String ns, String name, String[] enums, int[] vals, int dflt) Get optional enumeration attribute value from current start tag. | public Object | attributeExistingIDREF(String ns, String name, int index) Get previously defined object corresponding to IDREF attribute from
current start tag. | public float | attributeFloat(String ns, String name) Get float value of attribute from current start tag. | public float | attributeFloat(String ns, String name, float dflt) Get float value of optional attribute from current start tag. | public Object | attributeForwardIDREF(String ns, String name, int index) Get object (if defined yet) corresponding to IDREF attribute from
current start tag. | public int | attributeInt(String ns, String name) Get integer value of attribute from current start tag. | public int | attributeInt(String ns, String name, int dflt) Get integer value of optional attribute from current
start tag. | public long | attributeLong(String ns, String name) Get long value of attribute from current start tag. | public long | attributeLong(String ns, String name, long dflt) Get long value of optional attribute from current start tag. | public short | attributeShort(String ns, String name) Get short value of attribute from current start tag. | public short | attributeShort(String ns, String name, short dflt) Get short value of optional attribute from current start tag. | public String | attributeText(String ns, String name) Get text value of attribute from current start tag. | public String | attributeText(String ns, String name, String dflt) Get text value of optional attribute from current start
tag. | public static String | buildNameString(String ns, String name) Build name with optional namespace. | public String | buildPositionString() Build current parse input position description. | public void | checkAllowedAttributes(String[] nss, String[] names) Check that only allowed attributes are present on current start tag. | public boolean | convertBoolean(String text) Convert boolean value. | public byte | convertByte(String text) Convert byte value with exception wrapper. | public char | convertChar(String text) Convert char value with exception wrapper. | public Date | convertDate(String text) Convert java.util.Date value with exception wrapper. | public double | convertDouble(String text) Convert double value with exception wrapper. | public int | convertEnum(String target, String[] enums, int[] vals) Find required text value in enumeration. | public int | convertEnum(String target, String[] enums, int[] vals, int dflt) Find optional text value in enumeration. | public float | convertFloat(String text) Convert float value with exception wrapper. | public long | convertLong(String text) Convert long value with exception wrapper. | public short | convertShort(String text) Convert short value with exception wrapper. | public int | currentEvent() Get the current parse event type. | public String | currentNameString() Build current element name, with optional namespace. | public void | defineID(String id, int index, Object obj) Define object for ID. | public Object | findDefinedID(String id, int index) Find previously defined object corresponding to an ID. | public Object | findID(String id, int index) Find the object corresponding to an ID. | public int | getActiveNamespaceCount() Get count of active namespaces. | public String | getActiveNamespacePrefix(int index) Get prefix for an active namespace. | public String | getActiveNamespaceUri(int index) Get URI for an active namespace. | public int | getAttributeCount() Get number of attributes for current START_ELEMENT event. | public String | getAttributeName(int index) Get attribute name for current START_ELEMENT event. | public String | getAttributeNamespace(int index) Get attribute namespace for current START_ELEMENT event. | public String | getAttributePrefix(int index) Get attribute namespace prefix for current START_ELEMENT event. | public String | getAttributeValue(int index) Get attribute value for current START_ELEMENT event. | public String | getDocumentName() Return the supplied document name. | public String | getElementName() Returns current element name. | public String | getElementNamespace() Returns current element namespace URI. | public IBindingFactory | getFactory() Return the binding factory used to create this unmarshaller. | public String | getInputEncoding() Return the input encoding, if known. | public String | getName() Get name associated with current parse event. | public String | getNamespace() Get namespace associated with current parse event. | public int | getNamespaceCount() Get number of namespace declarations for current START_ELEMENT event. | public String | getNamespacePrefix(int index) Get namespace prefix for namespace declaration on current START_ELEMENT
event. | public String | getNamespaceUri(int index) Get namespace URI for namespace declaration on current START_ELEMENT
event. | public String | getNamespaceUri(String prefix) Get namespace URI matching prefix. | public String | getPrefix() Get namespace prefix associated with current parse event. | public int | getStackDepth() Get current unmarshalling object stack depth. | public Object | getStackObject(int depth) Get object from unmarshalling stack. | public Object | getStackTop() Get top object on unmarshalling stack. | public String | getText() Get text value for current event. | public IUnmarshaller | getUnmarshaller(int index) Find the unmarshaller for a particular class index in the current
context. | public IUnmarshaller | getUnmarshaller(String ns, String name) Find the unmarshaller for a particular element name (including
namespace) in the current context. | public Object | getUserContext() Get the user context object. | public boolean | hasAnyAttribute(String[] nss, String[] names) Check if any of several attributes is present on current start tag. | public boolean | hasAttribute(String ns, String name) Check if attribute is present on current start tag. | public boolean | isAt(String ns, String name) Check if next tag is start of element. | public boolean | isEnd() Check if next tag is an end tag. | public boolean | isStart() Check if next tag is a start tag. | protected void | mapUnmarshalling(int index) Map unmarshalling for element. | public int | next() Advance to next major parse event. | public int | nextToken() Advance to next parse event. | public byte | parseContentByte(String ns, String tag) Parse past end of element, returning byte value of content. | public char | parseContentChar(String ns, String tag) Parse past end of element, returning char value of content. | public int | parseContentEnumeration(String ns, String tag, String[] enums, int[] vals) Parse past end of element, returning enumeration value of content. | public int | parseContentInt(String ns, String tag) Parse past end of element, returning integer value of
content. | public short | parseContentShort(String ns, String tag) Parse past end of element, returning short value of content. | public String | parseContentText() Parse required text content. | public String | parseContentText(String ns, String tag) Parse past end of element, returning optional text content. | public boolean | parseElementBoolean(String ns, String tag) Parse entire element, returning boolean value of content. | public boolean | parseElementBoolean(String ns, String tag, boolean dflt) Parse entire element, returning boolean value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. | public byte | parseElementByte(String ns, String tag) Parse entire element, returning byte value of content. | public byte | parseElementByte(String ns, String tag, byte dflt) Parse entire element, returning byte value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. | public char | parseElementChar(String ns, String tag) Parse entire element, returning char value of content. | public char | parseElementChar(String ns, String tag, char dflt) Parse entire element, returning char value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. | public Date | parseElementDate(String ns, String tag) Parse past end of element, returning java.util.Date value
of content. | public Date | parseElementDate(String ns, String tag, Date dflt) Parse entire element, returning java.util.Date value of
optional content. | public double | parseElementDouble(String ns, String tag) Parse past end of element, returning double value of content. | public double | parseElementDouble(String ns, String tag, double dflt) Parse entire element, returning double value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. | public int | parseElementEnumeration(String ns, String tag, String[] enums, int[] vals, int dflt) Parse entire element, returning enumeration value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. | public Object | parseElementExistingIDREF(String ns, String tag, int index) Parse entire element, returning previously defined object corresponding
to content interpreted as IDREF. | public float | parseElementFloat(String ns, String tag) Parse past end of element, returning float value of content. | public float | parseElementFloat(String ns, String tag, float dflt) Parse entire element, returning float value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. | public Object | parseElementForwardIDREF(String ns, String tag, int index) Parse entire element, returning object (if defined yet) corresponding
to content interpreted as IDREF. | public int | parseElementInt(String ns, String tag) Parse entire element, returning integer value of content. | public int | parseElementInt(String ns, String tag, int dflt) Parse entire optional element, returning integer value of content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. | public long | parseElementLong(String ns, String tag) Parse past end of element, returning long value of content. | public long | parseElementLong(String ns, String tag, long dflt) Parse entire element, returning long value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. | public short | parseElementShort(String ns, String tag) Parse entire element, returning short value of content. | public short | parseElementShort(String ns, String tag, short dflt) Parse entire element, returning short value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. | public String | parseElementText(String ns, String tag) Parse entire element, returning text content. | public String | parseElementText(String ns, String tag, String dflt) Parse entire element, returning optional text content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. | public boolean | parseIfStartTag(String ns, String name) Parse past start of element. | public void | parsePastCurrentEndTag(String ns, String name) Parse past current end of element. | public void | parsePastElement(String ns, String tag) Parse past element, ignoring all content. | public void | parsePastEndTag(String ns, String name) Parse past end of element. | public void | parsePastStartTag(String ns, String name) Parse past start of element. | public void | parseToStartTag(String ns, String name) Parse to start of element. | public void | popObject() Pop unmarshalled object from stack. | public void | pushObject(Object obj) Push created object to unmarshalling stack. | public void | pushTrackedObject(Object obj) Push created object to unmarshalling stack with position tracking. | public void | registerBackFill(String id, int index, BackFillReference fill) Register back fill item for undefined ID value. | public void | registerBackFill(int index, BackFillReference fill) Register back fill item for last parsed ID value. | public void | removeUnmarshalling(int index) Undefine unmarshalling for element. | public void | reset() Reset unmarshalling information. | public void | setDocument(InputStream ins, String name, String enc, boolean nsa) Set document to be parsed from stream. | public void | setDocument(InputStream ins, String enc) Set document to be parsed from stream. | public void | setDocument(Reader rdr, String name, boolean nsa) Set document to be parsed from reader. | public void | setDocument(Reader rdr) Set document to be parsed from reader. | public void | setDocument(InputStream ins, String name, String enc) Set named document to be parsed from stream. | public void | setDocument(Reader rdr, String name) Set named document to be parsed from reader. | public void | setDocument(IXMLReader rdr) Set input document parse source directly. | public void | setFromContext(UnmarshallingContext parent) Initializes the context to use the same parser and document as another
unmarshalling context. | public void | setUserContext(Object obj) Set a user context object. | public void | skipElement() Skip past current element. | public void | throwEndTagNameError(String ns, String name) Throw exception for expected element end tag not found. | public void | throwException(String msg) Throw exception with position information. | public void | throwException(String msg, Exception ex) Throw exception with position information and nested exception. | public void | throwNameException(String msg, String ns, String name) Throw exception including a name and position information. | public void | throwStartTagException(String msg) Throw exception with start tag and position information. | public void | throwStartTagException(String msg, Exception ex) Throw exception with start tag, position information, and nested
exception. | public void | throwStartTagNameError(String ns, String name) Throw exception for expected element start tag not found. | public String | toEnd() Parse to end tag. | public String | toStart() Parse to start tag. | public int | toTag() Parse to start or end tag. | public Object | unmarshalDocument(InputStream ins, String enc) Unmarshal document from stream to object. | public Object | unmarshalDocument(Reader rdr) Unmarshal document from reader to object. | public Object | unmarshalDocument(InputStream ins, String name, String enc) Unmarshal named document from stream to object. | public Object | unmarshalDocument(Reader rdr, String name) Unmarshal named document from reader to object. | public Object | unmarshalElement(Class clas) Unmarshal required element of specified type. | public Object | unmarshalElement() Unmarshal required element. | public Object | unmarshalOptionalElement() Unmarshal optional element. |
m_globalCount | protected int m_globalCount(Code) | | Number of classes with global unmarshallers.
|
m_idClasses | protected String[] m_idClasses(Code) | | Class names of referenced types (null unless class-specific
IDs used).
|
m_idMaps | protected HashMap[] m_idMaps(Code) | | ID maps for finding references.
|
m_idref | protected String m_idref(Code) | | Last IDREF value parsed.
|
m_indexes | protected Integer[] m_indexes(Code) | | Wrapped index values used with unmarshalling map.
|
m_names | protected String[] m_names(Code) | | Names for elements associated with class mappings.
|
m_namespaces | protected String[] m_namespaces(Code) | | Namespaces for elements associated with class mappings.
|
m_objectStack | protected Object[] m_objectStack(Code) | | Stack of objects being unmarshalled.
|
m_stackDepth | protected int m_stackDepth(Code) | | Current unmarshalling stack depth.
|
m_unmarshalMap | protected HashMap m_unmarshalMap(Code) | | Mapping from element name to class index. If only a single namespace
is defined for a particular local name the value for that name in
this table is the Integer index of the associated class. If multiple
namespaces are defined using the same local name the value is an
ArrayList of Integer indexes. This is a high-overhead construct, so
lazy construction is used - it's built the first time needed, then kept
up to date thereafter.
|
m_unmarshallerClasses | protected String[] m_unmarshallerClasses(Code) | | Unmarshaller classes for mapping definition (null for
mappings out of context).
|
m_unmarshallers | protected IUnmarshaller[] m_unmarshallers(Code) | | Unmarshallers for classes in mapping definition (lazy create of actual
unmarshaller instances)
|
m_userContext | protected Object m_userContext(Code) | | User context object (not used by JiBX, only for user convenience).
|
UnmarshallingContext | public UnmarshallingContext(int nmap, String[] umcs, String[] nss, String[] names, String[] idcs, IBindingFactory ifact)(Code) | | Constructor. Builds the actual parser and initializes internal data
structures.
Parameters: nmap - number of mapping definitions included Parameters: umcs - names of unmarshaller classes for indexes with fixedunmarshallers (as opposed to mapping slots, which may be overridden;reference kept, must be constant) Parameters: nss - namespaces for elements of classes with global definitions Parameters: names - names for elements of classes with global definitions Parameters: idcs - array of class names with IDs (null if no IDs orglobal IDs) Parameters: ifact - binding factory creating this unmarshaller |
UnmarshallingContext | public UnmarshallingContext()(Code) | | Default constructor. This can be used for creating a context outside of
the generated code for special purposes.
|
accumulateText | public String accumulateText() throws JiBXException(Code) | | Accumulate text content. This skips past comments and processing
instructions, and consolidates text and entities to a single string. Any
unexpanded entity references found are treated as errors.
consolidated text string (empty string if no text components) exception: JiBXException - on error in unmarshalling |
addUnmarshalling | public void addUnmarshalling(int index, String ns, String name, String cname)(Code) | | Define unmarshalling for element. Enables the unmarshalling definition
linking an element name (including namespace) with a handler. The
unmarshalling definitions use fixed indexes for each class, allowing
direct lookup of the unmarshaller when multiple versions are defined.
Parameters: index - class index for unmarshalling definition Parameters: ns - namespace for element (may be null or the empty string for the empty namespace) Parameters: name - name for element Parameters: cname - name of class created by unmarshaller |
attributeBoolean | public boolean attributeBoolean(String ns, String name) throws JiBXException(Code) | | Get boolean value of attribute from current start tag. Throws an
exception if the attribute is not found in the start tag, or if it is
not a valid integer value.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected attribute boolean value throws: JiBXException - if attribute not present or not a valid booleanvalue |
attributeBoolean | public boolean attributeBoolean(String ns, String name, boolean dflt) throws JiBXException(Code) | | Get boolean value of optional attribute from current start tag. If the
attribute is not present the supplied default value is returned instead.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: dflt - value to be returned if attribute is not present attribute boolean value throws: JiBXException - if attribute value is not a valid boolean |
attributeByte | public byte attributeByte(String ns, String name) throws JiBXException(Code) | | Get byte value of attribute from current start tag. Throws an exception
if the attribute is not found in the start tag, or if it is not a valid
integer value.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected attribute byte value throws: JiBXException - if attribute not present or not a valid byte value |
attributeByte | public byte attributeByte(String ns, String name, byte dflt) throws JiBXException(Code) | | Get byte value of optional attribute from current start tag. If the
attribute is not present the supplied default value is returned instead.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: dflt - value to be returned if attribute is not present attribute byte value throws: JiBXException - if attribute value is not a valid byte |
attributeChar | public char attributeChar(String ns, String name) throws JiBXException(Code) | | Get char value of attribute from current start tag. Throws an exception
if the attribute is not found in the start tag, or if it is not a valid
integer value.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected attribute char value throws: JiBXException - if attribute not present or not a valid char value |
attributeChar | public char attributeChar(String ns, String name, char dflt) throws JiBXException(Code) | | Get char value of optional attribute from current start tag. If the
attribute is not present the supplied default value is returned instead.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: dflt - value to be returned if attribute is not present attribute char value throws: JiBXException - if attribute value is not a valid char |
attributeDate | public Date attributeDate(String ns, String name) throws JiBXException(Code) | | Get java.util.Date value of attribute from current start
tag. Throws an exception if the attribute is not found in the start tag,
or if it is not a valid integer value.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected attribute Date value throws: JiBXException - if attribute not present or not a valid Datevalue |
attributeDate | public Date attributeDate(String ns, String name, Date dflt) throws JiBXException(Code) | | Get java.util.Date value of optional attribute from current
start tag. If the attribute is not present the supplied default value is
returned instead.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: dflt - value to be returned if attribute is not present attribute Date value throws: JiBXException - if attribute value is not a valid Date |
attributeDouble | public double attributeDouble(String ns, String name) throws JiBXException(Code) | | Get double value of attribute from current start tag. Throws an exception
if the attribute is not found in the start tag, or if it is not a valid
integer value.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected attribute double value throws: JiBXException - if attribute not present or not a valid doublevalue |
attributeDouble | public double attributeDouble(String ns, String name, double dflt) throws JiBXException(Code) | | Get double value of optional attribute from current start tag. If the
attribute is not present the supplied default value is returned instead.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: dflt - value to be returned if attribute is not present attribute double value throws: JiBXException - if attribute value is not a valid double |
attributeEnumeration | public int attributeEnumeration(String ns, String name, String[] enums, int[] vals) throws JiBXException(Code) | | Get enumeration attribute value from current start tag.
Throws an exception if the attribute value is not found in the start
tag or the text does not match a value defined in the enumeration table.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: enums - ordered array of texts included in enumeration Parameters: vals - array of values to be returned for corresponding text matchpositions (position returned directly if this is null ) enumeration value for target text throws: JiBXException - if attribute not present or value not found inenumeration list |
attributeEnumeration | public int attributeEnumeration(String ns, String name, String[] enums, int[] vals, int dflt) throws JiBXException(Code) | | Get optional enumeration attribute value from current start tag.
Throws an exception if the attribute value is present but does not match
a value defined in the enumeration table.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: enums - ordered array of texts included in enumeration Parameters: vals - array of values to be returned for corresponding text matchpositions (position returned directly if this is null ) Parameters: dflt - default value returned if attribute is not present enumeration value for target text throws: JiBXException - if attribute not present or value not found inenumeration list |
attributeExistingIDREF | public Object attributeExistingIDREF(String ns, String name, int index) throws JiBXException(Code) | | Get previously defined object corresponding to IDREF attribute from
current start tag.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: index - expected reference type index object corresponding to IDREF throws: JiBXException - if attribute not present, ID not defined, ormapped to a different type of object than expected |
attributeFloat | public float attributeFloat(String ns, String name) throws JiBXException(Code) | | Get float value of attribute from current start tag. Throws an exception
if the attribute is not found in the start tag, or if it is not a valid
integer value.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected attribute float value throws: JiBXException - if attribute not present or not a valid float value |
attributeFloat | public float attributeFloat(String ns, String name, float dflt) throws JiBXException(Code) | | Get float value of optional attribute from current start tag. If the
attribute is not present the supplied default value is returned instead.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: dflt - value to be returned if attribute is not present attribute float value throws: JiBXException - if attribute value is not a valid float |
attributeForwardIDREF | public Object attributeForwardIDREF(String ns, String name, int index) throws JiBXException(Code) | | Get object (if defined yet) corresponding to IDREF attribute from
current start tag.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: index - expected reference type index object corresponding to IDREF, or null if notyet defined throws: JiBXException - if attribute not present, or ID mapped to adifferent type of object than expected |
attributeInt | public int attributeInt(String ns, String name) throws JiBXException(Code) | | Get integer value of attribute from current start tag.
Throws an exception if the attribute is not found in the start
tag, or if it is not a valid integer value.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected attribute integer value throws: JiBXException - if attribute not present or not a valid integervalue |
attributeInt | public int attributeInt(String ns, String name, int dflt) throws JiBXException(Code) | | Get integer value of optional attribute from current
start tag. If the attribute is not present the supplied default value
is returned instead.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: dflt - value to be returned if attribute is not present attribute integer value throws: JiBXException - if attribute value is not a valid integer |
attributeLong | public long attributeLong(String ns, String name) throws JiBXException(Code) | | Get long value of attribute from current start tag. Throws an exception
if the attribute is not found in the start tag, or if it is not a valid
integer value.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected attribute long value throws: JiBXException - if attribute not present or not a valid long value |
attributeLong | public long attributeLong(String ns, String name, long dflt) throws JiBXException(Code) | | Get long value of optional attribute from current start tag. If the
attribute is not present the supplied default value is returned instead.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: dflt - value to be returned if attribute is not present attribute long value throws: JiBXException - if attribute value is not a valid long |
attributeShort | public short attributeShort(String ns, String name) throws JiBXException(Code) | | Get short value of attribute from current start tag. Throws an exception
if the attribute is not found in the start tag, or if it is not a valid
integer value.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected attribute short value throws: JiBXException - if attribute not present or not a valid short value |
attributeShort | public short attributeShort(String ns, String name, short dflt) throws JiBXException(Code) | | Get short value of optional attribute from current start tag. If the
attribute is not present the supplied default value is returned instead.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: dflt - value to be returned if attribute is not present attribute short value throws: JiBXException - if attribute value is not a valid short |
attributeText | public String attributeText(String ns, String name) throws JiBXException(Code) | | Get text value of attribute from current start tag.
Throws an exception if the attribute value is not found in the start
tag.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected attribute value text throws: JiBXException - if attribute not present |
attributeText | public String attributeText(String ns, String name, String dflt)(Code) | | Get text value of optional attribute from current start
tag. If the attribute is not present the supplied default value is
returned instead.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected Parameters: dflt - value to be returned if attribute is not present attribute value text |
buildNameString | public static String buildNameString(String ns, String name)(Code) | | Build name with optional namespace. Just returns the appropriate
name format.
Parameters: ns - namespace URI of name Parameters: name - local name part of name formatted name string |
buildPositionString | public String buildPositionString()(Code) | | Build current parse input position description.
text description of current parse position |
checkAllowedAttributes | public void checkAllowedAttributes(String[] nss, String[] names) throws JiBXException(Code) | | Check that only allowed attributes are present on current start tag.
Throws an exception if not currently positioned on a start tag, or if
an attribute is present which is not in the list.
Parameters: nss - namespace URIs for allowed attributes (each may benull or the empty string for the empty namespace) Parameters: names - alphabetical list of attribute names expected (duplicatesnames are ordered by namespace URI) throws: JiBXException - on any error (possibly wrapping other exception) |
convertBoolean | public boolean convertBoolean(String text) throws JiBXException(Code) | | Convert boolean value. This internal method is used by all the boolean
unmarshalling calls. It accepts "true" or "1" as equivalent, and "false"
or "0" as equivalent, and throws exceptions for anything else.
Parameters: text - text for value to be converted converted boolean value throws: JiBXException - if not a valid boolean value |
convertByte | public byte convertByte(String text) throws JiBXException(Code) | | Convert byte value with exception wrapper. This internal method is used
by all the byte unmarshalling calls. It adds position information to
any exceptions that occur.
Parameters: text - text for value to be converted converted byte value throws: JiBXException - if not a valid byte value |
convertChar | public char convertChar(String text) throws JiBXException(Code) | | Convert char value with exception wrapper. This internal method is used
by all the char unmarshalling calls. It adds position information to
any exceptions that occur.
Parameters: text - text for value to be converted converted char value throws: JiBXException - if not a valid char value |
convertDate | public Date convertDate(String text) throws JiBXException(Code) | | Convert java.util.Date value with exception wrapper. This
internal method is used by all the Date unmarshalling calls. It adds
position information to any exceptions that occur.
Parameters: text - text for value to be converted converted Date value throws: JiBXException - if not a valid Date value |
convertDouble | public double convertDouble(String text) throws JiBXException(Code) | | Convert double value with exception wrapper. This internal method is used
by all the double unmarshalling calls. It adds position information to
any exceptions that occur.
Parameters: text - text for value to be converted converted double value throws: JiBXException - if not a valid double value |
convertEnum | public int convertEnum(String target, String[] enums, int[] vals) throws JiBXException(Code) | | Find required text value in enumeration. Looks up and returns the
enumeration value corresponding to the target text.
Parameters: target - text to be found in enumeration Parameters: enums - ordered array of texts included in enumeration Parameters: vals - array of values to be returned for corresponding text matchpositions (position returned directly if this is null ) enumeration value for target text throws: JiBXException - if target text not found in enumeration |
convertEnum | public int convertEnum(String target, String[] enums, int[] vals, int dflt) throws JiBXException(Code) | | Find optional text value in enumeration. Looks up and returns the
enumeration value corresponding to the target text, or the default
value if the text is null .
Parameters: target - text to be found in enumeration (may be null ) Parameters: enums - ordered array of texts included in enumeration Parameters: vals - array of values to be returned for corresponding text matchpositions (position returned directly if this is null ) Parameters: dflt - default value returned if target text is null enumeration value for target text throws: JiBXException - if target text not found in enumeration |
convertFloat | public float convertFloat(String text) throws JiBXException(Code) | | Convert float value with exception wrapper. This internal method is used
by all the float unmarshalling calls. It adds position information to
any exceptions that occur.
Parameters: text - text for value to be converted converted float value throws: JiBXException - if not a valid float value |
convertLong | public long convertLong(String text) throws JiBXException(Code) | | Convert long value with exception wrapper. This internal method is used
by all the long unmarshalling calls. It adds position information to
any exceptions that occur.
Parameters: text - text for value to be converted converted long value throws: JiBXException - if not a valid long value |
convertShort | public short convertShort(String text) throws JiBXException(Code) | | Convert short value with exception wrapper. This internal method is used
by all the short unmarshalling calls. It adds position information to
any exceptions that occur.
Parameters: text - text for value to be converted converted short value throws: JiBXException - if not a valid short value |
currentEvent | public int currentEvent() throws JiBXException(Code) | | Get the current parse event type. This wraps the base parser call in
order to catch and handle exceptions, and to preserve a reasonable level
of parser independence.
event type for current parse event exception: JiBXException - on any error (possibly wrapping other exception) |
currentNameString | public String currentNameString()(Code) | | Build current element name, with optional namespace.
formatted name string |
defineID | public void defineID(String id, int index, Object obj) throws JiBXException(Code) | | Define object for ID. Adds the owning object to a map with the ID
value as key. Throws an exception if the object class does not match
that expected from forward references, or if another object has
previously been registered with the same ID.
Parameters: id - text ID value Parameters: index - ID class index number Parameters: obj - object corresponding to element throws: JiBXException - if duplicate ID or wrong class |
findDefinedID | public Object findDefinedID(String id, int index) throws JiBXException(Code) | | Find previously defined object corresponding to an ID. This does the
lookup and checks that the referenced object has been defined.
Parameters: id - ID text Parameters: index - expected reference type index object corresponding to IDREF throws: JiBXException - on any error |
findID | public Object findID(String id, int index) throws JiBXException(Code) | | Find the object corresponding to an ID. This method just handles the
lookup and checks the object type.
Parameters: id - ID text Parameters: index - expected reference type index object corresponding to IDREF, or null if notyet defined throws: JiBXException - on any error |
getActiveNamespaceCount | public int getActiveNamespaceCount()(Code) | | Get count of active namespaces.
number of active namespaces in stack |
getActiveNamespacePrefix | public String getActiveNamespacePrefix(int index)(Code) | | Get prefix for an active namespace.
Parameters: index - stack position of namespace to be returned prefix for namespace at position throws: IllegalArgumentException - if invalid index |
getActiveNamespaceUri | public String getActiveNamespaceUri(int index)(Code) | | Get URI for an active namespace.
Parameters: index - index number of namespace to be returned URI for namespace at position throws: IllegalArgumentException - if invalid index |
getAttributeCount | public int getAttributeCount()(Code) | | Get number of attributes for current START_ELEMENT event. The results are
undefined if called when not at a START_ELEMENT event.
number of attributes, or -1 if not at START_ELEMENT throws: IllegalStateException - if not at a start tag (optional) |
getAttributeName | public String getAttributeName(int index)(Code) | | Get attribute name for current START_ELEMENT event. The results are
undefined if called when not at a START_ELEMENT event.
Parameters: index - index number of attribute to be returned name of attribute at position throws: IllegalStateException - if not at a start tag or invalid index |
getAttributeNamespace | public String getAttributeNamespace(int index)(Code) | | Get attribute namespace for current START_ELEMENT event. The results are
undefined if called when not at a START_ELEMENT event.
Parameters: index - index number of attribute to be returned namespace URI of attribute at position, empty string if none throws: IllegalStateException - if not at a start tag or invalid index |
getAttributePrefix | public String getAttributePrefix(int index)(Code) | | Get attribute namespace prefix for current START_ELEMENT event. The
results are undefined if called when not at a START_ELEMENT event.
Parameters: index - index number of attribute to be returned prefix for namespace of attribute at position, null if none throws: IllegalStateException - if not at a start tag or invalid index |
getAttributeValue | public String getAttributeValue(int index)(Code) | | Get attribute value for current START_ELEMENT event. The results are
undefined if called when not at a START_ELEMENT event.
Parameters: index - index number of attribute to be returned value of attribute at position throws: IllegalStateException - if not at a start tag or invalid index |
getDocumentName | public String getDocumentName()(Code) | | Return the supplied document name.
supplied document name (null if none) |
getElementName | public String getElementName() throws JiBXException(Code) | | Returns current element name.
local name part of name, or null if not at a startor end tag throws: JiBXException - if error from parser |
getElementNamespace | public String getElementNamespace() throws JiBXException(Code) | | Returns current element namespace URI.
namespace URI of name, or null if not at a startor end tag throws: JiBXException - if error from parser |
getFactory | public IBindingFactory getFactory()(Code) | | Return the binding factory used to create this unmarshaller.
binding factory |
getInputEncoding | public String getInputEncoding()(Code) | | Return the input encoding, if known. This is only valid after parsing of
a document has been started.
input encoding (null if unknown) |
getName | public String getName()(Code) | | Get name associated with current parse event.
name text for name associated with event (START_ELEMENT,END_ELEMENT, or ENTITY_REF only) throws: IllegalStateException - if not at a start or end tag (optional) |
getNamespace | public String getNamespace()(Code) | | Get namespace associated with current parse event.
URI for namespace associated with event (START_ELEMENT orEND_ELEMENT only), empty string if none throws: IllegalStateException - if not at a start or end tag (optional) |
getNamespaceCount | public int getNamespaceCount()(Code) | | Get number of namespace declarations for current START_ELEMENT event. The
results are undefined if called when not at a START_ELEMENT event.
number of namespace declarations, or -1 if not atSTART_ELEMENT |
getNamespacePrefix | public String getNamespacePrefix(int index)(Code) | | Get namespace prefix for namespace declaration on current START_ELEMENT
event. The results are undefined if called when not at a START_ELEMENT
event.
Parameters: index - index number of declaration to be returned namespace prefix for declaration at position, throws: IllegalArgumentException - if invalid index |
getNamespaceUri | public String getNamespaceUri(int index)(Code) | | Get namespace URI for namespace declaration on current START_ELEMENT
event. The results are undefined if called when not at a START_ELEMENT
event.
Parameters: index - index number of declaration to be returned namespace URI for declaration at position throws: IllegalArgumentException - if invalid index |
getNamespaceUri | public String getNamespaceUri(String prefix)(Code) | | Get namespace URI matching prefix.
Parameters: prefix - namespace prefix to be matched (null fordefault namespace) namespace URI for prefix |
getPrefix | public String getPrefix()(Code) | | Get namespace prefix associated with current parse event.
prefix for namespace associated with event (START_ELEMENT orEND_ELEMENT only), null if none throws: IllegalStateException - if not at a start or end tag (optional) |
getStackDepth | public int getStackDepth()(Code) | | Get current unmarshalling object stack depth. This allows tracking
nested calls to unmarshal one object while in the process of
unmarshalling another object. The bottom item on the stack is always the
root object being unmarshalled.
number of objects in unmarshalling stack |
getStackObject | public Object getStackObject(int depth)(Code) | | Get object from unmarshalling stack. This stack allows tracking nested
calls to unmarshal one object while in the process of unmarshalling
another object. The bottom item on the stack is always the root object
being unmarshalled.
Parameters: depth - object depth in stack to be retrieved (must be in the rangeof zero to the current depth minus one). object from unmarshalling stack |
getStackTop | public Object getStackTop()(Code) | | Get top object on unmarshalling stack. This is safe to call even when no
objects are on the stack.
object from unmarshalling stack, or null if none |
getText | public String getText()(Code) | | Get text value for current event.
text value for event |
getUnmarshaller | public IUnmarshaller getUnmarshaller(int index) throws JiBXException(Code) | | Find the unmarshaller for a particular class index in the current
context.
Parameters: index - class index for unmarshalling definition unmarshalling handler for class throws: JiBXException - if unable to create unmarshaller |
getUnmarshaller | public IUnmarshaller getUnmarshaller(String ns, String name) throws JiBXException(Code) | | Find the unmarshaller for a particular element name (including
namespace) in the current context.
Parameters: ns - namespace for element (may be null or the empty string for the empty namespace) Parameters: name - name for element unmarshalling handler for element, or null if nonefound throws: JiBXException - if unable to create unmarshaller |
hasAnyAttribute | public boolean hasAnyAttribute(String[] nss, String[] names) throws JiBXException(Code) | | Check if any of several attributes is present on current start tag.
Throws an exception if not currently positioned on a start tag.
Parameters: nss - namespace URIs for expected attributes (each may benull or the empty string for the empty namespace) Parameters: names - attribute names expected true if at least one of the named attributes ispresent, false if not throws: JiBXException - on any error (possibly wrapping other exception) |
hasAttribute | public boolean hasAttribute(String ns, String name) throws JiBXException(Code) | | Check if attribute is present on current start tag. Throws an exception
if not currently positioned on a start tag.
Parameters: ns - namespace URI for expected attribute (may be null or the empty string for the empty namespace) Parameters: name - attribute name expected true if named attribute is present,false if not throws: JiBXException - on any error (possibly wrapping other exception) |
isAt | public boolean isAt(String ns, String name) throws JiBXException(Code) | | Check if next tag is start of element. If not currently positioned at a
start or end tag this first advances the parse to the next start or end
tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: name - element name expected true if at start of element with supplied name,false if not throws: JiBXException - on any error (possibly wrapping other exception) |
isEnd | public boolean isEnd() throws JiBXException(Code) | | Check if next tag is an end tag. If not currently positioned at a
start or end tag this first advances the parse to the next start or
end tag.
true if at end of element, false ifat start throws: JiBXException - on any error (possibly wrapping other exception) |
isStart | public boolean isStart() throws JiBXException(Code) | | Check if next tag is a start tag. If not currently positioned at a
start or end tag this first advances the parse to the next start or
end tag.
true if at start of element, false ifat end throws: JiBXException - on any error (possibly wrapping other exception) |
mapUnmarshalling | protected void mapUnmarshalling(int index)(Code) | | Map unmarshalling for element. Adds the entry for a particular class
index to the unmarshalling map.
Parameters: index - class index for unmarshalling definition to be added |
next | public int next() throws JiBXException(Code) | | Advance to next major parse event. This wraps the base parser call in
order to catch and handle exceptions, and to preserve a reasonable level
of parser independence.
event type for next major parse event (START_TAG, TEXT, END_TAG,or END_DOCUMENT) exception: JiBXException - on any error (possibly wrapping other exception) |
nextToken | public int nextToken() throws JiBXException(Code) | | Advance to next parse event. This wraps the base parser call in order to
catch and handle exceptions, and to preserve a reasonable level of parser
independence.
event type for next parse event exception: JiBXException - on any error (possibly wrapping other exception) |
parseContentByte | public byte parseContentByte(String ns, String tag) throws JiBXException(Code) | | Parse past end of element, returning byte value of content. Assumes
you've already parsed past the start tag of the element, so it just looks
for text content followed by the end tag, and returns with the parser
positioned after the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected converted value from element text throws: JiBXException - on any error (possible wrapping other exception) |
parseContentChar | public char parseContentChar(String ns, String tag) throws JiBXException(Code) | | Parse past end of element, returning char value of content. Assumes
you've already parsed past the start tag of the element, so it just looks
for text content followed by the end tag, and returns with the parser
positioned after the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected converted value from element text throws: JiBXException - on any error (possible wrapping other exception) |
parseContentEnumeration | public int parseContentEnumeration(String ns, String tag, String[] enums, int[] vals) throws JiBXException(Code) | | Parse past end of element, returning enumeration value of content.
Assumes you've already parsed past the start tag of the element, so it
just looks for text content followed by the end tag, and returns with the
parser positioned after the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: enums - ordered array of texts included in enumeration Parameters: vals - array of values to be returned for corresponding text matchpositions (position returned directly if this is null ) enumeration value for element text throws: JiBXException - on any error (possible wrapping other exception) |
parseContentInt | public int parseContentInt(String ns, String tag) throws JiBXException(Code) | | Parse past end of element, returning integer value of
content. Assumes you've already parsed past the start tag of the
element, so it just looks for text content followed by the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected converted value from element text throws: JiBXException - on any error (possible wrapping other exception) |
parseContentShort | public short parseContentShort(String ns, String tag) throws JiBXException(Code) | | Parse past end of element, returning short value of content. Assumes
you've already parsed past the start tag of the element, so it just looks
for text content followed by the end tag, and returns with the parser
positioned after the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected converted value from element text throws: JiBXException - on any error (possible wrapping other exception) |
parseContentText | public String parseContentText() throws JiBXException(Code) | | Parse required text content. Assumes the parse is already positioned at
the text content, so just returns the text.
content text found throws: JiBXException - on any error (possible wrapping other exception) |
parseContentText | public String parseContentText(String ns, String tag) throws JiBXException(Code) | | Parse past end of element, returning optional text content. Assumes
you've already parsed past the start tag of the element, so it just looks
for text content followed by the end tag, and returns with the parser
positioned after the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected content text from element throws: JiBXException - on any error (possible wrapping other exception) |
parseElementBoolean | public boolean parseElementBoolean(String ns, String tag) throws JiBXException(Code) | | Parse entire element, returning boolean value of content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected converted value from element text throws: JiBXException - on any error (possible wrapping other exception) |
parseElementBoolean | public boolean parseElementBoolean(String ns, String tag, boolean dflt) throws JiBXException(Code) | | Parse entire element, returning boolean value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. Returns the default value if the element is not present.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: dflt - default value content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementByte | public byte parseElementByte(String ns, String tag) throws JiBXException(Code) | | Parse entire element, returning byte value of content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementByte | public byte parseElementByte(String ns, String tag, byte dflt) throws JiBXException(Code) | | Parse entire element, returning byte value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. Returns the default value if no content is present.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: dflt - default value content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementChar | public char parseElementChar(String ns, String tag) throws JiBXException(Code) | | Parse entire element, returning char value of content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementChar | public char parseElementChar(String ns, String tag, char dflt) throws JiBXException(Code) | | Parse entire element, returning char value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. Returns the default value if the element is not present.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: dflt - default value content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementDate | public Date parseElementDate(String ns, String tag) throws JiBXException(Code) | | Parse past end of element, returning java.util.Date value
of content. Expects to find the element start tag, text content,
and end tag, in that order, and returns with the parser positioned
following the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected converted value from element text throws: JiBXException - on any error (possible wrapping other exception) |
parseElementDate | public Date parseElementDate(String ns, String tag, Date dflt) throws JiBXException(Code) | | Parse entire element, returning java.util.Date value of
optional content. Expects to find the element start tag, text content,
and end tag, in that order, and returns with the parser positioned
following the end tag. Returns the default value if the element is not
present.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: dflt - default value content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementDouble | public double parseElementDouble(String ns, String tag) throws JiBXException(Code) | | Parse past end of element, returning double value of content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected converted value from element text throws: JiBXException - on any error (possible wrapping other exception) |
parseElementDouble | public double parseElementDouble(String ns, String tag, double dflt) throws JiBXException(Code) | | Parse entire element, returning double value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. Returns the default value if the element is not present.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: dflt - default value content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementEnumeration | public int parseElementEnumeration(String ns, String tag, String[] enums, int[] vals, int dflt) throws JiBXException(Code) | | Parse entire element, returning enumeration value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. Returns the default value if no content is present.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: enums - ordered array of texts included in enumeration Parameters: vals - array of values to be returned for corresponding text matchpositions (position returned directly if this is null ) Parameters: dflt - default value enumeration value for element text throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementExistingIDREF | public Object parseElementExistingIDREF(String ns, String tag, int index) throws JiBXException(Code) | | Parse entire element, returning previously defined object corresponding
to content interpreted as IDREF. Expects to find the element start tag,
text content, and end tag, in that order, and returns with the parser
positioned following the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - attribute name expected Parameters: index - expected reference type index object corresponding to IDREF throws: JiBXException - if attribute not present, ID not defined, ormapped to a different type of object than expected |
parseElementFloat | public float parseElementFloat(String ns, String tag) throws JiBXException(Code) | | Parse past end of element, returning float value of content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected converted value from element text throws: JiBXException - on any error (possible wrapping other exception) |
parseElementFloat | public float parseElementFloat(String ns, String tag, float dflt) throws JiBXException(Code) | | Parse entire element, returning float value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. Returns the default value if the element is not present.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: dflt - default value content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementForwardIDREF | public Object parseElementForwardIDREF(String ns, String tag, int index) throws JiBXException(Code) | | Parse entire element, returning object (if defined yet) corresponding
to content interpreted as IDREF. Expects to find the element start tag,
text content, and end tag, in that order, and returns with the parser
positioned following the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - attribute name expected Parameters: index - expected reference type index object corresponding to IDREF, or null if notyet defined throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementInt | public int parseElementInt(String ns, String tag) throws JiBXException(Code) | | Parse entire element, returning integer value of content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementInt | public int parseElementInt(String ns, String tag, int dflt) throws JiBXException(Code) | | Parse entire optional element, returning integer value of content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. Returns the default value if the element is missing or
has no content.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: dflt - default value content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementLong | public long parseElementLong(String ns, String tag) throws JiBXException(Code) | | Parse past end of element, returning long value of content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected converted value from element text throws: JiBXException - on any error (possible wrapping other exception) |
parseElementLong | public long parseElementLong(String ns, String tag, long dflt) throws JiBXException(Code) | | Parse entire element, returning long value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. Returns the default value if the element is not present.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: dflt - default value content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementShort | public short parseElementShort(String ns, String tag) throws JiBXException(Code) | | Parse entire element, returning short value of content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementShort | public short parseElementShort(String ns, String tag, short dflt) throws JiBXException(Code) | | Parse entire element, returning short value of optional content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. Returns the default value if no content is present.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: dflt - default value content text from element throws: JiBXException - on any error (possibly wrapping other exception) |
parseElementText | public String parseElementText(String ns, String tag) throws JiBXException(Code) | | Parse entire element, returning text content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected content text from element throws: JiBXException - on any error (possible wrapping other exception) |
parseElementText | public String parseElementText(String ns, String tag, String dflt) throws JiBXException(Code) | | Parse entire element, returning optional text content.
Expects to find the element start tag, text content, and end tag,
in that order, and returns with the parser positioned following
the end tag. Returns the default text if the element is not found.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected Parameters: dflt - default text value content text from element throws: JiBXException - on any error (possible wrapping other exception) |
parseIfStartTag | public boolean parseIfStartTag(String ns, String name) throws JiBXException(Code) | | Parse past start of element. Ignores character data to next start or end
tag, but throws exception if an end tag is seen before a start tag, or if
the start tag seen does not match the expected name. Leaves the parse
positioned following the start tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: name - element name expected throws: JiBXException - on any error (possibly wrapping other exception) |
parsePastCurrentEndTag | public void parsePastCurrentEndTag(String ns, String name) throws JiBXException(Code) | | Parse past current end of element. Ignores character data to next start
or end tag, but throws exception if a start tag is seen before a end tag,
or if the end tag seen does not match the expected name. Leaves the parse
positioned following the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: name - element name expected throws: JiBXException - on any error (possibly wrapping other exception) |
parsePastElement | public void parsePastElement(String ns, String tag) throws JiBXException(Code) | | Parse past element, ignoring all content. This may be used while
positioned either before or on the element start tag. It checks if
currently positioned at the element start tag, and if so advances to the
next parse event. Then looks for the next end tag, ignoring character
data and skipping child elements. Leaves the parse positioned following
the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: tag - element name expected throws: JiBXException - on any error (possible wrapping other exception) |
parsePastEndTag | public void parsePastEndTag(String ns, String name) throws JiBXException(Code) | | Parse past end of element. If currently at a start tag parses past that
start tag, then ignores character data to next start or end tag, and
throws exception if a start tag is seen before a end tag, or if
the end tag seen does not match the expected name. Leaves the parse
positioned following the end tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: name - element name expected throws: JiBXException - on any error (possibly wrapping other exception) |
parsePastStartTag | public void parsePastStartTag(String ns, String name) throws JiBXException(Code) | | Parse past start of element. Ignores character data to next start or end
tag, but throws exception if an end tag is seen before a start tag, or if
the start tag seen does not match the expected name. Leaves the parse
positioned following the start tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: name - element name expected throws: JiBXException - on any error (possibly wrapping other exception) |
parseToStartTag | public void parseToStartTag(String ns, String name) throws JiBXException(Code) | | Parse to start of element. Ignores character data to next start or end
tag, but throws exception if an end tag is seen before a start tag, or if
the start tag seen does not match the expected name. Leaves the parse
positioned at the start tag.
Parameters: ns - namespace URI for expected element (may be null or the empty string for the empty namespace) Parameters: name - element name expected throws: JiBXException - on any error (possibly wrapping other exception) |
pushObject | public void pushObject(Object obj)(Code) | | Push created object to unmarshalling stack. This must be called before
beginning the unmarshalling of the object. It is only called for objects
with structure, not for those converted directly to and from text.
Parameters: obj - object being unmarshalled |
pushTrackedObject | public void pushTrackedObject(Object obj)(Code) | | Push created object to unmarshalling stack with position tracking. If the
object supports setting source location information, the location is also
set by this method.
Parameters: obj - object being unmarshalled |
registerBackFill | public void registerBackFill(String id, int index, BackFillReference fill) throws JiBXException(Code) | | Register back fill item for undefined ID value. This adds a holder to
the mapping table if not already present, then adds the back fill item
to the holder.
Parameters: id - target undefined ID value Parameters: index - target reference type index Parameters: fill - back fill item throws: JiBXException - if attribute not present, or ID already defined |
registerBackFill | public void registerBackFill(int index, BackFillReference fill) throws JiBXException(Code) | | Register back fill item for last parsed ID value. This adds a holder to
the mapping table if not already present, then adds the back fill item
to the holder. This form of call always applies to the last IDREF value
parsed (from either an element or an attribute).
Parameters: index - target reference type index Parameters: fill - back fill item throws: JiBXException - if attribute not present, or ID already defined |
removeUnmarshalling | public void removeUnmarshalling(int index)(Code) | | Undefine unmarshalling for element. Disables the unmarshalling
definition for a particular class index.
Parameters: index - class index for unmarshalling definition |
reset | public void reset()(Code) | | Reset unmarshalling information. This releases all references to
unmarshalled objects and prepares the context for potential reuse.
It is automatically called when input is set.
|
setDocument | public void setDocument(InputStream ins, String name, String enc, boolean nsa) throws JiBXException(Code) | | Set document to be parsed from stream. This call is not part of the
interface definition, but is supplied to allow direct control of the
namespace processing by the compiler. The option of disabling namespaces
should be considered experimental and may not be supported in the future.
Parameters: ins - stream supplying document data Parameters: name - document name (null if unknown) Parameters: enc - document input encoding, or null if to bedetermined by parser Parameters: nsa - enable namespace processing for parser flag throws: JiBXException - if error creating parser |
setDocument | public void setDocument(InputStream ins, String enc) throws JiBXException(Code) | | Set document to be parsed from stream.
Parameters: ins - stream supplying document data Parameters: enc - document input encoding, or null if to bedetermined by parser throws: JiBXException - if error creating parser |
setDocument | public void setDocument(Reader rdr, String name, boolean nsa) throws JiBXException(Code) | | Set document to be parsed from reader. This call is not part of the
interface definition, but is supplied to allow direct control of the
namespace processing by the compiler. The option of disabling namespaces
should be considered experimental and may not be supported in the future.
Parameters: rdr - reader supplying document data Parameters: name - document name (null if unknown) Parameters: nsa - enable namespace processing for parser flag throws: JiBXException - if error creating parser |
setDocument | public void setDocument(Reader rdr) throws JiBXException(Code) | | Set document to be parsed from reader.
Parameters: rdr - reader supplying document data throws: JiBXException - if error creating parser |
setDocument | public void setDocument(InputStream ins, String name, String enc) throws JiBXException(Code) | | Set named document to be parsed from stream.
Parameters: ins - stream supplying document data Parameters: name - document name Parameters: enc - document input encoding, or null if to bedetermined by parser throws: JiBXException - if error creating parser |
setDocument | public void setDocument(Reader rdr, String name) throws JiBXException(Code) | | Set named document to be parsed from reader.
Parameters: rdr - reader supplying document data Parameters: name - document name throws: JiBXException - if error creating parser |
setDocument | public void setDocument(IXMLReader rdr)(Code) | | Set input document parse source directly.
Parameters: rdr - document parse event reader |
setFromContext | public void setFromContext(UnmarshallingContext parent)(Code) | | Initializes the context to use the same parser and document as another
unmarshalling context. This method is designed for use when an initial
context needs to create and invoke a secondary context in the course of
an unmarshalling operation.
Parameters: parent - context supplying parser and document to be unmarshalled |
setUserContext | public void setUserContext(Object obj)(Code) | | Set a user context object. This context object is not used directly by
JiBX, but can be accessed by all types of user extension methods. The
context object is automatically cleared by the
UnmarshallingContext.reset() method,
so to make use of this you need to first call the appropriate version of
the setDocument() method, then this method, and finally the
UnmarshallingContext.unmarshalElement method.
Parameters: obj - user context object, or null if clearing existingcontext object See Also: UnmarshallingContext.getUserContext() |
skipElement | public void skipElement() throws JiBXException(Code) | | Skip past current element.
exception: JiBXException - on any error (possibly wrapping other exception) |
throwEndTagNameError | public void throwEndTagNameError(String ns, String name) throws JiBXException(Code) | | Throw exception for expected element end tag not found.
Parameters: ns - namespace URI of name Parameters: name - local name part of name exception: JiBXException - always thrown |
throwException | public void throwException(String msg) throws JiBXException(Code) | | Throw exception with position information.
Parameters: msg - exception message text exception: JiBXException - always thrown |
throwException | public void throwException(String msg, Exception ex) throws JiBXException(Code) | | Throw exception with position information and nested exception.
Parameters: msg - exception message text Parameters: ex - nested exception exception: JiBXException - always thrown |
throwNameException | public void throwNameException(String msg, String ns, String name) throws JiBXException(Code) | | Throw exception including a name and position information.
Parameters: msg - leading message text Parameters: ns - namespace URI of name Parameters: name - local name part of name exception: JiBXException - always thrown |
throwStartTagException | public void throwStartTagException(String msg) throws JiBXException(Code) | | Throw exception with start tag and position information.
Parameters: msg - exception message text exception: JiBXException - always thrown |
throwStartTagException | public void throwStartTagException(String msg, Exception ex) throws JiBXException(Code) | | Throw exception with start tag, position information, and nested
exception.
Parameters: msg - exception message text Parameters: ex - nested exception exception: JiBXException - always thrown |
throwStartTagNameError | public void throwStartTagNameError(String ns, String name) throws JiBXException(Code) | | Throw exception for expected element start tag not found.
Parameters: ns - namespace URI of name Parameters: name - local name part of name exception: JiBXException - always thrown |
toEnd | public String toEnd() throws JiBXException(Code) | | Parse to end tag. Ignores character data seen prior to an end tag, but
throws exception if a start tag or the end of the document is seen before
an end tag. Leaves the parser positioned at the end tag.
element name of end tag found throws: JiBXException - on any error (possibly wrapping other exception) |
toStart | public String toStart() throws JiBXException(Code) | | Parse to start tag. Ignores character data seen prior to a start tag, but
throws exception if an end tag or the end of the document is seen before
a start tag. Leaves the parser positioned at the start tag.
element name of start tag found throws: JiBXException - on any error (possibly wrapping other exception) |
toTag | public int toTag() throws JiBXException(Code) | | Parse to start or end tag. If not currently positioned at a start or end
tag this first advances the parse to the next start or end tag.
parser event type for start tag or end tag throws: JiBXException - on any error (possibly wrapping other exception) |
unmarshalElement | public Object unmarshalElement(Class clas) throws JiBXException(Code) | | Unmarshal required element of specified type. If not currently positioned
at a start or end tag this first advances the parse to the next start or
end tag. The returned object will always be assignable to the specified
type.
Parameters: clas - expected class of unmarshalled object unmarshalled object from element throws: JiBXException - on any error (possibly wrapping other exception) |
unmarshalElement | public Object unmarshalElement() throws JiBXException(Code) | | Unmarshal required element. If not currently positioned at a start or
end tag this first advances the parse to the next start or end tag.
unmarshalled object from element throws: JiBXException - on any error (possibly wrapping other exception) |
unmarshalOptionalElement | public Object unmarshalOptionalElement() throws JiBXException(Code) | | Unmarshal optional element. If not currently positioned at a start or
end tag this first advances the parse to the next start or end tag.
unmarshalled object from element, or null if end tagrather than start tag seen throws: JiBXException - on any error (possibly wrapping other exception) |
|
|