Package com.luciad.format.xml
Interface ILcdXMLDocumentContext
- All Known Implementing Classes:
TLcdXMLDocumentContext
public interface ILcdXMLDocumentContext
Deprecated.
Interface for accessing the context of an XML document being decoded.
This context allows to store and retrieve variables during the decoding
of an XML document. Each variable is stored using a key (to identify the
variable), and a scope (to indicate which other readers should be able
to access the variable).
Since there is typically only one instance of each
ILcdXMLElementReader
during the decoding of an XML document, readers cannot store any state about the XML
element they are currently processing (e.g., if an XML element has a child element
of the same type, the reader would overwrite its own state while reading the child
element). The XML document context can be used by readers to safely store contextual
information for the current element, using the Scope.LOCAL
scope.
Additionally, sometimes information needs to be shared by different readers
(e.g., a coordinate system is declared as an attribute of an XML element, and should
be applied to all of its children). In this case, the XML context can also be used to
store these variables, using the Scope.GLOBAL
scope (for document-wide
variables) or the Scope.DESCENDANTS
scope (for variables that should only
be visible by an XML element and all of its children).
An ILcdXMLDocumentContext
is typically created by the XML decoder,
users shouldn't implement this interface. The decoder will take care of all
context management (i.e., storing and retrieving contexts each time another
XML element is read).
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
Deprecated.A type-safe enumeration, representing all possible scopes to be used in XML document contexts. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.Notifies this document context that the current XML element has been ended.get
(Object aKey, ILcdXMLDocumentContext.Scope aScope) Deprecated.Retrieves the value of a variable in the document context.void
put
(Object aKey, Object aValue, ILcdXMLDocumentContext.Scope aScope) Deprecated.Stores a variable in the document context.void
Deprecated.Notifies this document context that a new XML element has been entered.
-
Method Details
-
put
Deprecated.Stores a variable in the document context.- Parameters:
aKey
- the key, used to identify the variable.aValue
- the value of the variable.aScope
- the scope, in which the variable should be visible.- Throws:
NullPointerException
- ifaKey
oraScope
isnull
.
-
get
Deprecated.Retrieves the value of a variable in the document context.- Parameters:
aKey
- the key, used to identify the object.aScope
- the scope in which the variable is stored.- Returns:
- the value of the variable with the given key and scope,
or
null
if no value was stored yet. - Throws:
NullPointerException
- ifaKey
oraScope
isnull
.
-
startElement
void startElement()Deprecated.Notifies this document context that a new XML element has been entered. -
endElement
void endElement()Deprecated.Notifies this document context that the current XML element has been ended.
-
com.format.xml
API has been deprecated. Instead, use thecom.format.xml.bind
API.