com.highdeal.hci
Class FileEnvelope

java.lang.Object
  extended by com.highdeal.hci.FileEnvelope
All Implemented Interfaces:
XMLMapping, XMLMarshallable

public class FileEnvelope
extends java.lang.Object
implements XMLMarshallable, XMLMapping

This class is used for save in and load from file a set of XMLMarshallable objects.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="objectSet">
   <xs:complexType>
     <xs:sequence>
       <xs:any minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
     <xs:attribute name="version" type="xs:string"/>
   </xs:complexType>
 </xs:element>


Constructor Summary
FileEnvelope()
          Creates a new FileEnvelope using the current SAP Convergent Charging version.
FileEnvelope(java.lang.String version)
          Creates a new FileEnvelope using the given String as version.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 void addElement(XMLMarshallable element)
          Adds an element.
 java.lang.Class<?> getClass(java.lang.String nsUri, java.lang.String tag, XMLAttributes atts)
          Returns the Java class for a specified XML tag and its attributes in a namespace.
 XMLMarshallable getElement(int i)
          Returns the element at the specified index.
 java.util.Vector<XMLMarshallable> getElements()
          Returns the Vector of elements.
 int getLength()
          Returns the number of elements embedded in this.
 java.lang.String getVersion()
          Returns the version used for this.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setVersion(java.lang.String version)
          Sets the version to be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileEnvelope

public FileEnvelope()
Creates a new FileEnvelope using the current SAP Convergent Charging version.

See Also:
Version

FileEnvelope

public FileEnvelope(java.lang.String version)
Creates a new FileEnvelope using the given String as version.

Parameters:
version - the version to be used.
Method Detail

getLength

public int getLength()
Returns the number of elements embedded in this.

Returns:
the size of content list.

addElement

public void addElement(XMLMarshallable element)
Adds an element.

Parameters:
element - the XMLMarshallable object to be added.

getElement

public XMLMarshallable getElement(int i)
Returns the element at the specified index.

Parameters:
i - the index of the element to retrieve.
Returns:
the element at the specified index.

getElements

public java.util.Vector<XMLMarshallable> getElements()
Returns the Vector of elements.

Returns:
a list of XMLMarshallable elements.

setVersion

public void setVersion(java.lang.String version)
Sets the version to be used.

Parameters:
version - the version to be used.

getVersion

public java.lang.String getVersion()
Returns the version used for this.

Returns:
the version field.

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the element being processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current element

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the object, the child representing the marshallable object which must be added to the element.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - The name of tag for the child
child - The child to be added

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - The character data to be added

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

getClass

public java.lang.Class<?> getClass(java.lang.String nsUri,
                                   java.lang.String tag,
                                   XMLAttributes atts)
Description copied from interface: XMLMapping
Returns the Java class for a specified XML tag and its attributes in a namespace.

Specified by:
getClass in interface XMLMapping
Parameters:
nsUri - The unique resource identifier of the namespace of the XML tag
tag - The local part of the XML tag
atts - The attributes of the XML tag
Returns:
A Java class with a default constructor

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)