Package com.luciad.format.xml
Class ALcdXMLIndexBasedElementAdapter
java.lang.Object
com.luciad.format.xml.ALcdXMLIndexBasedElementAdapter
- All Implemented Interfaces:
ILcdXMLElementAdapter
- Direct Known Subclasses:
ALcdXMLTypedIndexBasedElementAdapter
public abstract class ALcdXMLIndexBasedElementAdapter
extends Object
implements ILcdXMLElementAdapter
Deprecated.
An abstract class implementing
ILcdXMLElementAdapter, facilitating
the implementation of custom XML adapters.
Typically, when extending this class, the following methods need to be overwritten:
- when adding attributes:
- getAttributeCount()
- getAttributeName()
- getAttributeValue()
- when adding contents:
- getContentCount()
- getContent()
- isPrimitiveContent()
ILcdXMLElementAdapter interface are implemented by
this adapter using delegation to the getAttribute...() and getContent...() methods. They should
normally not be overwritten.
In most cases, it is advised to extend new element adapter classes from
ALcdXMLVisitorBasedElementAdapter, since implementations of that class are less
error-prone, more compact and have better serial access performance. Only if random access to
child elements is needed, performance is an issue and the domain model object to be adapted
offers random access, this adapter should be taken into consideration.-
Constructor Summary
ConstructorsConstructorDescriptionALcdXMLIndexBasedElementAdapter(ILcdXMLElementAdapterProvider aElementAdapterProvider, ILcdXMLElementNameProvider aElementNameProvider) Deprecated.Constructs a newALcdXMLIndexBasedElementAdapter, initialized with the specifiedILcdXMLElementAdapterProviderandILcdXMLElementNameProvider.ALcdXMLIndexBasedElementAdapter(ILcdXMLElementAdapterProvider aElementAdapterProvider, TLcdXMLName aElementName) Deprecated.Constructs a newALcdXMLIndexBasedElementAdapter, initialized with the specifiedILcdXMLElementAdapterProviderand a fixed element name. -
Method Summary
Modifier and TypeMethodDescriptionintgetAttributeCount(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack) Deprecated.By default, returns0.getAttributeName(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Inspects the object on top of the name/object stack: returns the name of the attribute at the given index.getAttributeValue(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Inspects the object on top of the name/object stack: returns the value of the attribute at the given index.getAttributeValue(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aAttributeName) Deprecated.Inspects the object on top of the name/object stack: returns the value of the attribute with the specified name, ornullif no such attribute exists.getAttributeValueAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Returns thetoString()value of the Object returned bygetAttributeValue().getAttributeValueAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aAttributeName) Deprecated.Inspects the object on top of the name/object stack: returns the value of the attribute with the specified name, as a String.getContent(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Inspects the object on top of the name/object stack: returns the content, at the given index.getContent(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex) Deprecated.The default implementation iterates over all contents, and counts the number of elements having the provided XML name, to retrieve the content at positionaIndex.getContentAdapter(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Returns an XML adapter for the content at the specified index.getContentAdapter(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex) Deprecated.Returns an XML adapter for the content at the specified index in the list of contents having the specified XML name.getContentAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Returns thetoString()value of the Object returned bygetContent().getContentAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex) Deprecated.Returns thetoString()value of the Object returned bygetContent().intgetContentCount(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack) Deprecated.By default, returns0.intgetContentCount(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName) Deprecated.The default implementation iterates over all contents, and counts the number of elements having the provided XML name.getContentName(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Returns the XML name for the content at the specified index.protected ILcdXMLElementAdapterProviderDeprecated.Returns theILcdXMLElementAdapterProviderfrom which child adapters are retrieved.protected ILcdXMLElementNameProviderDeprecated.Returns theILcdXMLElementNameProviderwhich is used to retrieve XML names.getName(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aSubstitutionGroup, Object aObject) Deprecated.Returns the name of the object specified by the given name/object stack, substitution group and object.booleanisPrimitiveContent(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.By default, returnsfalse.voidvisitAttributes(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) Deprecated.Visits the attributes of the element, specified by the given name and object stack .voidvisitContents(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) Deprecated.Visits the contents of the element, specified by the given name and object stack .voidvisitElement(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, TLcdXMLName aSubstitutionGroup, Object aObject, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) Deprecated.Visits the given element.
-
Constructor Details
-
ALcdXMLIndexBasedElementAdapter
public ALcdXMLIndexBasedElementAdapter(ILcdXMLElementAdapterProvider aElementAdapterProvider, ILcdXMLElementNameProvider aElementNameProvider) Deprecated.Constructs a newALcdXMLIndexBasedElementAdapter, initialized with the specifiedILcdXMLElementAdapterProviderandILcdXMLElementNameProvider.- Parameters:
aElementAdapterProvider- theILcdXMLElementAdapterProviderto be used for retrieving child adapters.aElementNameProvider- theILcdXMLElementNameProviderto be used for retrieving element names.
-
ALcdXMLIndexBasedElementAdapter
public ALcdXMLIndexBasedElementAdapter(ILcdXMLElementAdapterProvider aElementAdapterProvider, TLcdXMLName aElementName) Deprecated.Constructs a newALcdXMLIndexBasedElementAdapter, initialized with the specifiedILcdXMLElementAdapterProviderand a fixed element name.- Parameters:
aElementAdapterProvider- theILcdXMLElementAdapterProviderto be used for retrieving child adapters.aElementName- the name of the element handled by this adapter.
-
-
Method Details
-
getName
public TLcdXMLName getName(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aSubstitutionGroup, Object aObject) Deprecated.Description copied from interface:ILcdXMLElementAdapterReturns the name of the object specified by the given name/object stack, substitution group and object.- Specified by:
getNamein interfaceILcdXMLElementAdapter- Parameters:
aNameStack- the XML name stack, identifying the XML element to be inspected.aObjectStack- the XML object stack, identifying the XML element to be inspected.aSubstitutionGroup- the substitution group the returned element should belong to, if there is one (nullotherwise).aObject- the element for which to return a name.- Returns:
- the element name that best matches the specified element.
-
getAttributeCount
Deprecated.By default, returns0.- Specified by:
getAttributeCountin interfaceILcdXMLElementAdapter- Parameters:
aNameStack-aObjectStack-- Returns:
0
-
getAttributeName
public TLcdXMLName getAttributeName(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Description copied from interface:ILcdXMLElementAdapterInspects the object on top of the name/object stack: returns the name of the attribute at the given index.- Specified by:
getAttributeNamein interfaceILcdXMLElementAdapter- Parameters:
aNameStack- the XML name stack, identifying the XML element to be inspected.aObjectStack- the XML object stack, identifying the XML element to be inspected.aIndex- the index of the attribute whose name is to be returned.- Returns:
- the name of the attribute with the given index.
-
getAttributeValue
public Object getAttributeValue(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Description copied from interface:ILcdXMLElementAdapterInspects the object on top of the name/object stack: returns the value of the attribute at the given index.- Specified by:
getAttributeValuein interfaceILcdXMLElementAdapter- Parameters:
aNameStack- the XML name stack, identifying the XML element to be inspected.aObjectStack- the XML object stack, identifying the XML element to be inspected.aIndex- the index of the attribute whose value is to be returned.- Returns:
- the value of the attribute with the given index.
-
getAttributeValue
public Object getAttributeValue(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aAttributeName) Deprecated.Description copied from interface:ILcdXMLElementAdapterInspects the object on top of the name/object stack: returns the value of the attribute with the specified name, ornullif no such attribute exists.- Specified by:
getAttributeValuein interfaceILcdXMLElementAdapter- Parameters:
aNameStack- the XML name stack, identifying the XML element to be inspected.aObjectStack- the XML object stack, identifying the XML element to be inspected.aAttributeName- the name of the attribute for which to return a value.- Returns:
- the value of the attribute with the specified name.
-
getAttributeValueAsString
public String getAttributeValueAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Returns thetoString()value of the Object returned bygetAttributeValue().- Specified by:
getAttributeValueAsStringin interfaceILcdXMLElementAdapter- Parameters:
aNameStack-aObjectStack-aIndex-- Returns:
getAttributeValue(aNameStack, aObjectStack, aIndex).toString()
-
getAttributeValueAsString
public String getAttributeValueAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aAttributeName) Deprecated.Description copied from interface:ILcdXMLElementAdapterInspects the object on top of the name/object stack: returns the value of the attribute with the specified name, as a String.- Specified by:
getAttributeValueAsStringin interfaceILcdXMLElementAdapter- Parameters:
aNameStack- the XML name stack, identifying the XML element to be inspected.aObjectStack- the XML object stack, identifying the XML element to be inspected.aAttributeName- the name of the attribute for which to return a value.- Returns:
- the value of the attribute with the given index, as a String.
-
getContentCount
Deprecated.By default, returns0.- Specified by:
getContentCountin interfaceILcdXMLElementAdapter- Parameters:
aNameStack-aObjectStack-- Returns:
0
-
getContent
Deprecated.Description copied from interface:ILcdXMLElementAdapterInspects the object on top of the name/object stack: returns the content, at the given index.- Specified by:
getContentin interfaceILcdXMLElementAdapter- Parameters:
aNameStack- the XML name stack, identifying the XML element to be inspected.aObjectStack- the XML object stack, identifying the XML element to be inspected.aIndex- the index of the content whose name is to be returned.- Returns:
- the content with the given index.
-
getContentAsString
public String getContentAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Returns thetoString()value of the Object returned bygetContent().- Specified by:
getContentAsStringin interfaceILcdXMLElementAdapter- Parameters:
aNameStack-aObjectStack-aIndex-- Returns:
getContent(aNameStack, aObjectStack, aIndex).toString()
-
getContentName
public TLcdXMLName getContentName(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Returns the XML name for the content at the specified index. The implementation will delegate the request to theILcdXMLElementNameProviderthat was provided at construction time.- Specified by:
getContentNamein interfaceILcdXMLElementAdapter- Parameters:
aNameStack-aObjectStack-aIndex-- Returns:
- the name of the content with the given index.
-
getContentAdapter
public ILcdXMLElementAdapter getContentAdapter(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.Returns an XML adapter for the content at the specified index. The implementation will delegate the request to theILcdXMLElementAdapterProviderthat was provided at construction time.- Specified by:
getContentAdapterin interfaceILcdXMLElementAdapter- Parameters:
aNameStack-aObjectStack-aIndex-- Returns:
- a suitable adapter for the content at the given index.
-
getContentCount
public int getContentCount(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName) Deprecated.The default implementation iterates over all contents, and counts the number of elements having the provided XML name.- Specified by:
getContentCountin interfaceILcdXMLElementAdapter- Parameters:
aNameStack-aObjectStack-aXMLName-- Returns:
- the number of contents for the object on top of the name/object stack.
-
getContent
public Object getContent(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex) Deprecated.The default implementation iterates over all contents, and counts the number of elements having the provided XML name, to retrieve the content at positionaIndex.- Specified by:
getContentin interfaceILcdXMLElementAdapter- Parameters:
aNameStack-aObjectStack-aXMLName-aIndex-- Returns:
- the content with the given index.
-
getContentAsString
public String getContentAsString(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex) Deprecated.Returns thetoString()value of the Object returned bygetContent().- Specified by:
getContentAsStringin interfaceILcdXMLElementAdapter- Parameters:
aNameStack-aObjectStack-aXMLName- the name of the content to be returned.aIndex-- Returns:
getContent(aNameStack, aObjectStack, aXMLName, aIndex).toString()
-
getContentAdapter
public ILcdXMLElementAdapter getContentAdapter(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, TLcdXMLName aXMLName, int aIndex) Deprecated.Returns an XML adapter for the content at the specified index in the list of contents having the specified XML name. The implementation will delegate the request to theILcdXMLElementAdapterProviderthat was provided at construction time.- Specified by:
getContentAdapterin interfaceILcdXMLElementAdapter- Parameters:
aNameStack-aObjectStack-aXMLName- the name of the content for which to return an adapter.aIndex-- Returns:
- a suitable adapter for the content at the given index.
-
isPrimitiveContent
public boolean isPrimitiveContent(ILcdXMLNameStack aNameStack, ILcdXMLObjectStack aObjectStack, int aIndex) Deprecated.By default, returnsfalse.- Specified by:
isPrimitiveContentin interfaceILcdXMLElementAdapter- Parameters:
aNameStack-aObjectStack-aIndex-- Returns:
false
-
visitElement
public void visitElement(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, TLcdXMLName aSubstitutionGroup, Object aObject, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) throws TLcdXMLInterruptedException Deprecated.Description copied from interface:ILcdXMLElementAdapterVisits the given element. The element to be visited is specified by a name and object stack, containing the XML stack up to the parent name/object, and a (name,object) pair. TheILcdXMLElementVisitorinterface documentation contains a detailed description of how an XML element needs to be visited.- Specified by:
visitElementin interfaceILcdXMLElementAdapter- Parameters:
aNameStack- the XML name stack, identifying the XML element to be visited.aObjectStack- the XML object stack, identifying the XML element to be visited.aSubstitutionGroup- the element name or substitution group of the element to be visitedaObject- the lement to be visitedaElementVisitor- the element visitor which is called by this visitable.aDocumentContext- the XML document context- Throws:
TLcdXMLInterruptedException- if the visit action has been interrupted.- See Also:
-
visitAttributes
public void visitAttributes(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) throws TLcdXMLInterruptedException Deprecated.Description copied from interface:ILcdXMLElementAdapterVisits the attributes of the element, specified by the given name and object stack .- Specified by:
visitAttributesin interfaceILcdXMLElementAdapter- Parameters:
aNameStack- the XML name stack, identifying the XML element to be visited.aObjectStack- the XML object stack, identifying the XML element to be visited.aElementVisitor- the element visitor which is called by this visitable.aDocumentContext- the XML document context- Throws:
TLcdXMLInterruptedException- if the visit action has been interrupted.- See Also:
-
visitContents
public void visitContents(ILcdXMLEditableNameStack aNameStack, ILcdXMLEditableObjectStack aObjectStack, ILcdXMLElementVisitor aElementVisitor, ILcdXMLDocumentContext aDocumentContext) throws TLcdXMLInterruptedException Deprecated.Description copied from interface:ILcdXMLElementAdapterVisits the contents of the element, specified by the given name and object stack .- Specified by:
visitContentsin interfaceILcdXMLElementAdapter- Parameters:
aNameStack- the XML name stack, identifying the XML element to be visited.aObjectStack- the XML object stack, identifying the XML element to be visited.aElementVisitor- the element visitor which is called by this visitable.aDocumentContext- the XML document context- Throws:
TLcdXMLInterruptedException- if the visit action has been interrupted.- See Also:
-
getElementAdapterProvider
Deprecated.Returns theILcdXMLElementAdapterProviderfrom which child adapters are retrieved.- Returns:
- the
ILcdXMLElementAdapterProviderfrom which child adapters are retrieved.
-
getElementNameProvider
Deprecated.Returns theILcdXMLElementNameProviderwhich is used to retrieve XML names.- Returns:
- the
ILcdXMLElementNameProviderwhich is used to retrieve XML names.
-
com.format.xmlAPI has been deprecated. Instead, use thecom.format.xml.bindAPI.