DFDL4S (DFDL for Space Library)
Classes | Public Member Functions | List of all members
org.esa.s2g.dfdllib.Element Class Reference

Inherited by org.esa.s2g.dfdllib.PartialElement.

Classes

enum  REPRESENTATION_TYPE
 

Public Member Functions

String name ()
 
String absoluteName ()
 
String absoluteUniqueName ()
 
String uniqueName ()
 
Element parent ()
 
Element root ()
 
int childCount ()
 
int childAvailableCount ()
 
Element childAt (int index)
 
String propertyValueGet (String name)
 
DataSize size ()
 
DataSize sizeAvailable ()
 
byte[] retrieveRawData ()
 
byte[] retrieveRawData (int size, int offset)
 
String getValueAsRepresentation ()
 
String getValueAsRepresentation (REPRESENTATION_TYPE representationType)
 
byte[] getValueBytes ()
 
String getValueBinary ()
 
void setValueBytes (byte[] rawData)
 
DataSize offset ()
 
String toString ()
 
ErrorIndicator getError ()
 
String getIntrinsicType ()
 
String getValueHexadecimal ()
 
BigInteger getValueInteger ()
 
void setValueInteger (BigInteger value)
 
Float getValueFloat32 ()
 
void setValueFloat32 (Float value)
 
Double getValueFloat64 ()
 
void setValueFloat64 (Double value)
 
String getValueTime ()
 
void setValueTime (String valueTime)
 
BigInteger getRangeMinimum ()
 
BigInteger getRangeMaximum ()
 
boolean is (ElementTrait trait) throws Exception
 
Element evaluate (String path)
 
Boolean evaluateBoolean (String expression)
 
Long evaluateInteger (String expression)
 

Detailed Description

The Element class represents a domain element that is used to structure the binary data

Member Function Documentation

◆ absoluteName()

String org.esa.s2g.dfdllib.Element.absoluteName ( )

Get the absolute path to the Element, containing the root node.

Example for a ISP Element: /ISP/path_to_element

  • ISP: represents the top level element (Document element)
  • path_to_element: represents the path to a specific element
Returns
the absolute path to the element

◆ absoluteUniqueName()

String org.esa.s2g.dfdllib.Element.absoluteUniqueName ( )

Get the absolute path of the Element, containing the root node and suffixes if any.

Example for a ISP Element: /ISP/path_to_element/

  • ISP: represents the top level element (Document element)
  • path_to_element: represents the path to a specific element including the suffixes in the respective elements name. example: Measurements in occursCount: /ISP/X/Measurement[2]/Y or /ISP/X/Measurement[2] ([2] represents the second measurement (occursCount case)) according to schema section below: <xs:element name="Measurement" type="TypeMeasurement" maxOccurs="unbounded" dfdl:occursCountKind="fixed" dfdl:occursCount="2"/>
Returns
the absolute path to the element including the suffix.

◆ childAt()

Element org.esa.s2g.dfdllib.Element.childAt ( int  index)

Access the child at the given index

Parameters
indexthe index to retrieve the child
Returns
the requested child element

◆ childAvailableCount()

int org.esa.s2g.dfdllib.Element.childAvailableCount ( )

Get the number of children available in the element according to the schema definition

Returns
the number of children of the element according to the schema definition

◆ childCount()

int org.esa.s2g.dfdllib.Element.childCount ( )

Get the number of children of the element in the data stream

Note: This method depends on the Element type (Partial or Complete), since in the cases of Partial elements (e.g. element stored at the end of a truncated file), the return value will correspond to the number of children of the data available.

Returns
the number of children of the element

◆ evaluate()

Element org.esa.s2g.dfdllib.Element.evaluate ( String  path)

Gets the element for a given path expression

Parameters
path- path expression which points to an element
Returns
  • the element correspondent to the path expression, in case of:
Parameters
pathrepresents a valid path to an element
  • null, in case of:
pathis: (1) null; (2) ill-formed expression; (3) element with a given path expression doesn't exist.

◆ evaluateBoolean()

Boolean org.esa.s2g.dfdllib.Element.evaluateBoolean ( String  expression)
Evaluate an expression known to be a boolean value
Parameters
expressionthe expression to be evaluated
Returns
  • the boolean value obtained by evaluating the expression, in case of:
Parameters
expressionrepresents a valid expression to be evaluated
  • false, in case of:
expressionis (1) null; (2) ill-formed boolean expression;

◆ evaluateInteger()

Long org.esa.s2g.dfdllib.Element.evaluateInteger ( String  expression)
Evaluate an expression known to be an integer value
Parameters
expressionthe expression to be evaluated
Returns
  • the integer value obtained by evaluating the expression, in case of:
Parameters
expressionrepresents a valid expression to be evaluated
  • null, in case of:
expressionis (1) null; (2) ill-formed expression;

◆ getError()

ErrorIndicator org.esa.s2g.dfdllib.Element.getError ( )

Access error indicator related to this element. The user can check all types of error that could be present in this element with the ErrorIndicator object returned.

Returns
the error indicator object

◆ getIntrinsicType()

String org.esa.s2g.dfdllib.Element.getIntrinsicType ( )

Gets the element intrinsic type (xsd type)

Returns
the element xsd intrinsic type

◆ getRangeMaximum()

BigInteger org.esa.s2g.dfdllib.Element.getRangeMaximum ( )

For XSD_TYPES BYTE, SHORT, INT or LONG, return the maximum type value based on size

Returns
the maximum value

◆ getRangeMinimum()

BigInteger org.esa.s2g.dfdllib.Element.getRangeMinimum ( )

For XSD_TYPES BYTE, SHORT, INT or LONG, return the minimum type value based on size

Returns
the mininum value

◆ getValueAsRepresentation() [1/2]

String org.esa.s2g.dfdllib.Element.getValueAsRepresentation ( )

Access the value of the element according the representation or intrinsic type

Returns
  • the value as representation type, in case of:
    • dmx:representation is present in the schema and have a valid representation type
  • the value according to the intrinsic type, in case of:
    • dmx:representation is missing in the schema or wrong representation value defined
  • null in case of:
    • dmx:representation: is missing in the schema or wrong representation value defined
    • xs:<intrinsicType>: is missing in the schema or wrong type defined

◆ getValueAsRepresentation() [2/2]

String org.esa.s2g.dfdllib.Element.getValueAsRepresentation ( REPRESENTATION_TYPE  representationType)

Access the value of the element according to the given representation type.

Parameters
representationType
  • the representation type to get the element value
Returns
  • the value of the element according to the
Parameters
representationType
  • null, in case of:
representationTypeinvalid (null or invalid representation type)

◆ getValueBinary()

String org.esa.s2g.dfdllib.Element.getValueBinary ( )

Access the value of the element (according to the representation specified in the binary definition)

Returns
the value representation

◆ getValueBytes()

byte [] org.esa.s2g.dfdllib.Element.getValueBytes ( )

Access the clean and aligned data of the element

Returns
the clean data

◆ getValueFloat32()

Float org.esa.s2g.dfdllib.Element.getValueFloat32 ( )

Access the value of the element (according to the 'FLOAT_32' representation)

Returns
the value representation

◆ getValueFloat64()

Double org.esa.s2g.dfdllib.Element.getValueFloat64 ( )

Access the value of the element (according to the 'FLOAT_64' representation)

Returns
the value representation

◆ getValueHexadecimal()

String org.esa.s2g.dfdllib.Element.getValueHexadecimal ( )

Access the value of the element (according to the 'HEXADECIMAL' representation)

Returns
the value representation

◆ getValueInteger()

BigInteger org.esa.s2g.dfdllib.Element.getValueInteger ( )

Access the integer value of the element

Returns
the integer value of the element

◆ getValueTime()

String org.esa.s2g.dfdllib.Element.getValueTime ( )

Access the value of the element The value will be transformed according to he CCSDS Time Type defined for this element i.e. CUC, CDS, CCS, ASCII, A_DEF (agency defined)

Returns
the value representation

◆ is()

boolean org.esa.s2g.dfdllib.Element.is ( ElementTrait  trait) throws Exception

Check if this element is an ElementTrait instance

Parameters
trait- one type object of ElementTrait
Returns
true - if element belongs to the passed trait false - otherwise
Exceptions
Exception

◆ name()

String org.esa.s2g.dfdllib.Element.name ( )

Get the name of the element.

Note: In the cases where the Element is considered partial, a suffix ({Partial...}) is added to the Element name.

Example: APID or APID {Partial...}

Returns
the name of the element

◆ offset()

DataSize org.esa.s2g.dfdllib.Element.offset ( )

Get the DataSize object containing the number of bytes and bits corresponding to the offset of the element

Returns
the DataSize object corresponding to the offset of the element

◆ parent()

Element org.esa.s2g.dfdllib.Element.parent ( )

Get the parent of the element.

Note: When the element is the document element (the top element in a tree) a null is returned.

Returns
  • the parent of the element
  • null, if the element is the document element

◆ propertyValueGet()

String org.esa.s2g.dfdllib.Element.propertyValueGet ( String  name)

Access the value of a property with a given name

Parameters
-namethe name of the property requested
Returns
  • the requested property, in case of:
Parameters
nameexists;
  • null, in case of:
nameinvalid (null or doesn't exist)

◆ retrieveRawData() [1/2]

byte [] org.esa.s2g.dfdllib.Element.retrieveRawData ( )
Retrieve the array of bytes storing information of the given element
According to the element size/offset, this byte array may contain left and/or right bits that are not relevant.

Note: The data that is not word aligned and may require cleaning of leading and trailing bits.

Returns
the raw data

◆ retrieveRawData() [2/2]

byte [] org.esa.s2g.dfdllib.Element.retrieveRawData ( int  size,
int  offset 
)
Retrieve the array of bytes storing information of the given element
According to the desired size/offset of the element, this byte array may contain left and/or right bits that are not relevant.

Note: The data that is not word aligned and may require cleaning of leading and trailing bits.

Parameters
size
  • the size of the retrieve data after the
offset.
offset
  • the start position for the retrieval of data
Returns
the raw data

◆ root()

Element org.esa.s2g.dfdllib.Element.root ( )

Get the packet element (below document) that contains this element

Returns
the top element

◆ setValueBytes()

void org.esa.s2g.dfdllib.Element.setValueBytes ( byte[]  rawData)

Update the raw data of the element

Notice that data that is not word aligned.

Parameters
rawDatathe raw data

◆ setValueFloat32()

void org.esa.s2g.dfdllib.Element.setValueFloat32 ( Float  value)

Set the value of the element (according to the 'FLOAT_32' representation)

Parameters
valuethe value to be set

◆ setValueFloat64()

void org.esa.s2g.dfdllib.Element.setValueFloat64 ( Double  value)

Set the value of the element (according to the 'FLOAT_64' representation)

Parameters
valuethe value to be set

◆ setValueInteger()

void org.esa.s2g.dfdllib.Element.setValueInteger ( BigInteger  value)

Set the value of the element (according to the 'INTEGER' representation)

Parameters
valuethe value to be set

◆ setValueTime()

void org.esa.s2g.dfdllib.Element.setValueTime ( String  valueTime)

Set the value of the element The value will be transformed according to he CCSDS Time Type defined for this element i.e. CUC, CDS, CCS, ASCII, A_DEF (agency defined)

Parameters
valueTimethe value representation

◆ size()

DataSize org.esa.s2g.dfdllib.Element.size ( )

Get the DataSize object containing the expected size (number of bytes and bits) of the Element according to the schema

Note: This method is independent of the Element type (Partial or Complete), it will return always the expect size of the element according to the schema.

Returns
  • the expected (DataSize) size of the element according to the schema

◆ sizeAvailable()

DataSize org.esa.s2g.dfdllib.Element.sizeAvailable ( )

Get the DataSize object containing the size available (number of bytes and bits) for this Element.

Note: This method depends on the Element type (Partial or Complete), since in the cases of Partial elements (e.g. element stored at the end of a truncated file), the return value will correspond to the size of the data available.

Returns
  • the size (DataSize) of the data available

◆ toString()

String org.esa.s2g.dfdllib.Element.toString ( )

Access the string representation of the element

Returns
the element as string

◆ uniqueName()

String org.esa.s2g.dfdllib.Element.uniqueName ( )

Get the Element name, including the suffix

  • example:
    • Measurements in occursCount case: Measurement[1] or Measurement[2] according to the schema section:

      <xs:element name="Measurement" type="TypeMeasurement" maxOccurs="unbounded" dfdl:occursCountKind="fixed" dfdl:occursCount="2"/>

Returns
the unique name of the element with the suffix included

The documentation for this class was generated from the following file: