public abstract class RecordDefinition extends Object implements Serializable
Record along with the respective FieldDefinition
holds all the metadata available for the Record and the hoste4d Fields. All extending classes of this
class must define a default no arguments constructor| Modifier and Type | Field and Description |
|---|---|
protected IBuffer.TransportDirective |
directive
The transport directive of the
Record, initially set to IBuffer.TransportDirective.Inherit |
protected List<FieldDefinition> |
Fields
The field definitions available for the hosted
Fields |
| Constructor and Description |
|---|
RecordDefinition()
Creates a new instance
|
RecordDefinition(List<FieldDefinition> fieldDefinitions)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyFrom(RecordDefinition other) |
void |
deflate(DataOutput out)
Deflates the state and information kept in the
RecordDefinition. |
boolean |
equals(Object obj) |
abstract void |
extendDeflate(DataOutput out)
Method that needs to be implemented by the
RecordDefinition extenders to deflate any additional information
kept |
abstract boolean |
extendEquals(Object obj)
Method that needs to be implemented by the
RecordDefinition extenders to extend the equality logic
based on additional logic contained in the implementations |
abstract void |
extendFromXML(Element element) |
abstract void |
extendInflate(DataInput in)
Method that needs to be implemented by the
RecordDefinition extenders to inflate any additional information
previously deflated by the respective extender method |
abstract void |
extendToXML(Element element) |
void |
fromXML(Element element) |
FieldDefinition |
getDefinition(int index)
Retrieves the field definition with the provided index
|
int |
getDefinition(String name)
Retrieves the field definition with the provided name
|
int |
getDefinitionSize()
Retrieves the length of the field definitions
|
IBuffer.TransportDirective |
getTransportDirective()
Retrieves the transport directive
|
void |
inflate(DataInput in)
Inflates the previously deflated information of this
RecordDefinition. |
void |
setTransportDirective(IBuffer.TransportDirective directive)
Sets the transport directive for this
Record |
Element |
toXML(Document doc) |
protected List<FieldDefinition> Fields
Fieldsprotected IBuffer.TransportDirective directive
Record, initially set to IBuffer.TransportDirective.Inheritpublic RecordDefinition()
public RecordDefinition(List<FieldDefinition> fieldDefinitions)
fieldDefinitions - the field definitionspublic void copyFrom(RecordDefinition other) throws GRS2RecordSerializationException
GRS2RecordSerializationExceptionpublic FieldDefinition getDefinition(int index)
index - the index of the definitionpublic int getDefinition(String name)
name - the name of the definitionpublic int getDefinitionSize()
public void setTransportDirective(IBuffer.TransportDirective directive)
Recorddirective - the directivepublic IBuffer.TransportDirective getTransportDirective()
public boolean equals(Object obj)
To check for equality, the type of the argument is checked. The field definitions length in both definitions must be
the same as well as the defined IBuffer.TransportDirective. For each field definition hosted, FieldDefinition.equals(Object)
is invoked and finally the extendEquals(Object) is consulted. If any of the above conditions are
not met, the two instances are not equal
equals in class ObjectObject.equals(java.lang.Object)public abstract boolean extendEquals(Object obj)
RecordDefinition extenders to extend the equality logic
based on additional logic contained in the implementationsobj - the object to check equality forpublic void deflate(DataOutput out) throws GRS2RecordSerializationException
RecordDefinition. After deflating the locally maintained
information, for each field definition hosted, FieldDefinition.deflate(DataOutput) is invoked
and finally, Field.extendDeflate(java.io.DataOutput)out - the stream to deflate the information toGRS2RecordSerializationException - there was a problem serializing the definition statepublic final Element toXML(Document doc) throws GRS2RecordSerializationException, GRS2RecordDefinitionException, DOMException
public final void fromXML(Element element) throws GRS2RecordSerializationException, GRS2RecordDefinitionException, DOMException
public abstract void extendDeflate(DataOutput out) throws GRS2RecordSerializationException
RecordDefinition extenders to deflate any additional information
keptout - the stream to deflate toGRS2RecordSerializationException - there was a serialization errorpublic void inflate(DataInput in) throws GRS2RecordSerializationException
RecordDefinition. After retrieving the locally maintained
information, for all the hosted fields, the FieldDefinition.inflate(DataInput) is called, and finally
extendInflate(DataInput) is invokedin - the stream to inflate fromGRS2RecordSerializationException - there was a problem deserializing the definition statepublic abstract void extendInflate(DataInput in) throws GRS2RecordSerializationException
RecordDefinition extenders to inflate any additional information
previously deflated by the respective extender methodin - the stream to inflate fromGRS2RecordSerializationException - there was a problem deserializing the definition statepublic abstract void extendFromXML(Element element) throws GRS2RecordSerializationException
GRS2RecordSerializationExceptionpublic abstract void extendToXML(Element element) throws GRS2RecordSerializationException
GRS2RecordSerializationExceptionCopyright © 2014. All Rights Reserved.