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

Public Member Functions

long size ()
 
byte[] getCleanAlignedData (DataSize size, DataSize offset)
 
byte[] getRawData (DataSize size, DataSize offset)
 
void close ()
 
Element childAt (int index)
 
Element childAt (int index, String evaluateHooks, String firstHeaderPointer) throws ErrorLoadingException
 
int childCount ()
 
List< EntrygetSyncHistory ()
 
Element createElement (String name)
 
Element createElement (String name, Element parent)
 
Element createElementTime (String name, Element parent, String value)
 
Element createElementInteger (String name, Element parent, BigInteger value)
 
Element createElementFloat32 (String name, Element parent, Float value)
 
Element createElementFloat64 (String name, Element parent, Double value)
 
Element createElementBytes (String name, Element parent, byte[] value)
 
void validate ()
 

Detailed Description

The Document class represents the root of the domain element that is used to structure the binary data

Member Function Documentation

◆ childAt() [1/2]

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

Access the child at the given index (does not evaluate hooks)

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

◆ childAt() [2/2]

Element org.esa.s2g.dfdllib.Document.childAt ( int  index,
String  evaluateHooks,
String  firstHeaderPointer 
) throws ErrorLoadingException

Access the child at the given index

Parameters
indexthe index to retrieve the child
evaluateHooksflag indicating that DFDL model hooks should be evaluated 1) null - hooks will not be evaluated 2) otherwise - hook will be evaluated
firstHeaderPointerthe path to the element First Header Pointer (used for showing internal ISP in TF files)
Returns
the requested child element
Exceptions
ErrorLoadingException

◆ childCount()

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

Access the number of children of the element

Returns
the number of children of the element

◆ close()

void org.esa.s2g.dfdllib.Document.close ( )

Close the document, releasing all associated resources.

◆ createElement() [1/2]

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

Create a root element

Parameters
namethe name of element
Returns
root element of a document item
Exceptions
EmptyNameException
NotHandcraftedDocumentException

◆ createElement() [2/2]

Element org.esa.s2g.dfdllib.Document.createElement ( String  name,
Element  parent 
)

Create element child of parent element

Parameters
namethe name of element
parentthe parent of the new element
Returns
element child of the given parent
Exceptions
EmptyNameException
NullParentException
NotHandcraftedDocumentException

◆ createElementBytes()

Element org.esa.s2g.dfdllib.Document.createElementBytes ( String  name,
Element  parent,
byte[]  value 
)

Create element child of parent element with the specific value

Parameters
namethe name of element
parentthe parent of the new element
value
Returns
element child of the given parent
Exceptions
EmptyNameException
NullParentException
NotHandcraftedDocumentException

◆ createElementFloat32()

Element org.esa.s2g.dfdllib.Document.createElementFloat32 ( String  name,
Element  parent,
Float  value 
)

Create element child of parent element with the specific value

Parameters
namethe name of element
parentthe parent of the new element
value
Returns
element child of the given parent
Exceptions
EmptyNameException
NullParentException
NotHandcraftedDocumentException

◆ createElementFloat64()

Element org.esa.s2g.dfdllib.Document.createElementFloat64 ( String  name,
Element  parent,
Double  value 
)

Create element child of parent element with the specific value

Parameters
namethe name of element
parentthe parent of the new element
value
Returns
element child of the given parent
Exceptions
EmptyNameException
NullParentException
NotHandcraftedDocumentException

◆ createElementInteger()

Element org.esa.s2g.dfdllib.Document.createElementInteger ( String  name,
Element  parent,
BigInteger  value 
)

Create element child of parent element with the specific value

Parameters
namethe name of element
parentthe parent of the new element
value
Returns
element child of the given parent
Exceptions
EmptyNameException
NullParentException
NotHandcraftedDocumentException

◆ createElementTime()

Element org.esa.s2g.dfdllib.Document.createElementTime ( String  name,
Element  parent,
String  value 
)

Create element child of parent element with the specific value

Parameters
namethe name of element
parentthe parent of the new element
value
Returns
element child of the given parent
Exceptions
EmptyNameException
NullParentException
NotHandcraftedDocumentException

◆ getCleanAlignedData()

byte [] org.esa.s2g.dfdllib.Document.getCleanAlignedData ( DataSize  size,
DataSize  offset 
)

Retrieve the array of bytes storing information of the given element The content of the byte array is shifted to guarantee that significant bits begin at the least significant bit of the array.

Parameters
sizethe size of requested data
offsetthe offset of requested data
Returns
the byte array containing data (in big endian) for the element

◆ getRawData()

byte [] org.esa.s2g.dfdllib.Document.getRawData ( DataSize  size,
DataSize  offset 
)

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.

Parameters
sizethe size of requested data
offsetthe offset of requested data
Returns
the byte array containing data (in big endian) for the element

◆ getSyncHistory()

List<Entry> org.esa.s2g.dfdllib.Document.getSyncHistory ( )

Get the set of synchronization errors registered during document interpretation

Returns
the List of ReporEvents containing all the synchronization errors registered during document interpretation

◆ size()

long org.esa.s2g.dfdllib.Document.size ( )

Access the size of the stored data.

Returns
the size in bytes of the stored data.

◆ validate()

void org.esa.s2g.dfdllib.Document.validate ( )

Validate the current document with the created elements and the specified schema

Returns
true document is valid false otherwise
Exceptions
InvalidPathExpressionException
NumberOfChildsIsWrongException
LeafElementWithoutValueException
NotHandcraftedDocumentException

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