Class ElementDTO

  • All Implemented Interfaces:
    Cloneable

    public class ElementDTO
    extends Object
    implements Cloneable
    The element of a possibly complex, nested structure, converted into a simple, linear array.
    • Field Detail

      • MAX_NAME_LENGTH

        public static final int MAX_NAME_LENGTH
        The maximum length used for name property. Introduced due to SAP(R) ABAP limits.
        See Also:
        Constant Field Values
      • id

        public int id
        Element identifier. This is used to identify the element as a parent of another element. The values must be positive and the elements must be arranged in ascending order.

        Elements with identical id may follow each other immediately, but only for simple fields (simple type values, e.g. "string"), and are interpreted as splitting up of a large value.

      • pId

        public int pId
        The id of the parent structure where this element belongs to. The order of elements must follow a strict order so that when a structured element is added to the list, the internal fields of this structure must immediately follow. The top-level elements have a pId of -1.
      • name

        public String name
        The name of this element. This name needs to be unique only in respect to the parent structure.

        When the same name is repeated in the context of the same parent, it is assumed that the parent defines this element as a repeatable (array) element.

      • value

        public String value
        The value of the field. This is filled only for simple fields without further internal structure.

        While the length of the value is not generally restricted, some implementations may want to split up a very large value; this can be done by repeating the item with identical id value.

        The format follows the conventions of xml schema encoding, see http://www.w3.org/TR/xmlschema-2/; currently implemented is:

        • string - a plain string
        • int - digits base10, +-2^31
        • long - digits base10, +-2^63
        • decimal - +-123456.789
        • boolean - the literals true and false
        • dateTime - yyyy-MM-ddTHH:mm:ss, optionally .sss fractional seconds, optionally time zone (though curently not supported)
        • (base64Binary) only some implementations support transfer of binary data in base64 encoding - it is recommended to use the field binValue for this
        • json - a valid json object (see type)
      • type

        public String type
        The type of the structure. This is not strictly necessary since the receiving entity should be able to infer the structure with its own meta data. However, it may be used for sanity checks.

        For simple/primitive data it contains the datatype name known from xml schema, see http://www.w3.org/TR/xmlschema-2/; currently implemented is:

        • string
        • int
        • long
        • boolean
        • decimal
        • base64Binary
        Structures are designated by the unqualified java class name.
        Repeating elements - arrays - are designed by appending [] to the type.

        There is also a special type:

        • json
        The textual value is expected to represent a valid JSON object.
        The following rules apply:
        • if the name is not filled, the element itself is meaningless and the individual fields of the JSON object are to be interpreted as a stream of named elements with the corresponding values (simple, array or JSON object)
        • if the name is filled, the element represents a structure object with that name and the individual fields of the JSON object are to be interpreted as a nested stream of named sub-elements with the corresponding values (simple, array or JSON object)
      • valueBin

        public byte[] valueBin
        Used instead of 'value' to transfer binary content. Using this value avoids the necessity to convert binary data into a base64 string in the client code.
    • Constructor Detail

      • ElementDTO

        public ElementDTO()