Class FileEnvelope

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

public class FileEnvelope extends 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 Details

    • FileEnvelope

      public FileEnvelope()
      Creates a new FileEnvelope using the current SAP Convergent Charging version.
      See Also:
      • Version
    • FileEnvelope

      public FileEnvelope(String version)
      Creates a new FileEnvelope using the given String as version.
      Parameters:
      version - the version to be used.
  • Method Details

    • 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 Vector<XMLMarshallable> getElements()
      Returns the Vector of elements.
      Returns:
      a list of XMLMarshallable elements.
    • setVersion

      public void setVersion(String version)
      Sets the version to be used.
      Parameters:
      version - the version to be used.
    • getVersion

      public 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(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(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 Class<?> getClass(String nsUri, 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