public class JrpcgenStruct extends JrpcgenComplexType
JrpcgenStruct class represents a single structure defined
in an rpcgen "x"-file.JrpcgenXdrDefinition.Table, JrpcgenXdrDefinition.Typedocumentation| Constructor and Description |
|---|
JrpcgenStruct(JrpcgenContext context,
String identifier,
JrpcgenDeclaration.Table elements)
Constructs a
JrpcgenStruct and sets the identifier and all
its attribute elements. |
| Modifier and Type | Method and Description |
|---|---|
void |
dump()
Dumps the structure together with its attribute elements to
System.out. |
<T extends Appendable> |
dump(T appendable)
Dumps a description of the structure to the passed target object,
which implements the appendable interface
Appendable. |
void |
generateJavaFile()
Generates a Java file defining the class, which will represent an XDR struct.
|
JrpcgenDeclaration.Table |
getElements()
Returns the elements of this structure.
|
String |
toString()
Returns a string representation of the structure.
|
getDefinitionName, getJavaClass, getJavaName, getXdrClass, isBaseType, isBooleanType, isOpaqueType, isStringType, isVoid, writeEqualsExpression, writeJavaToXdr, writeJavaToXdr, writeXdrConstructorCall, writeXdrConstructorCall, writeXdrDecodingCall, writeXdrDynamicVectorDecodingCall, writeXdrDynamicVectorEncodingCall, writeXdrEncodingCall, writeXdrEncodingCall, writeXdrFixedVectorDecodingCall, writeXdrFixedVectorEncodingCall, writeXdrToJava, writeXdrVectorCodingMethodsgetIdentifier, getXdrType, isConst, isEnum, isStruct, isTypedef, isUnionappendDeprecatedOrNothing, appendDeprecatedOrNothing, documentationIsEmpty, documentationIsProvided, emptyDocumentation, getDocumentation, getIdentedDocu, getIdentedDocu, isDeprecated, writeDocumentation, writeDocumentationpublic JrpcgenStruct(JrpcgenContext context, String identifier, JrpcgenDeclaration.Table elements)
JrpcgenStruct and sets the identifier and all
its attribute elements.context - The context the new struct belongs to.identifier - Identifier to be declared.elements - Table of declarations based on class
JrpcgenDeclaration.public final JrpcgenDeclaration.Table getElements()
public void generateJavaFile()
XdrAble.
At least, the generated class will offer members for the structure elements, a default constructor, a decoding constructor as well as an encoding and a decoding method. If the structure is used in a fixed and/or dynamic vector context, static methods providing encoding and decoding of a vector of the structure are additionally written. Dependant on the options the generated class may vary:
-ser (serializable) is given: The generated class will
implement the interface Serializable-bean is given: The generated class will provide
getters and setters to access the member fields. The member fields
will have a reduced visibility allowing direct access to the struct and
its extending classes, only.-noToString is not given:
The generated class will provide an own implementation of the
toString()-method.-noEquals is not given:
The generated class will provide own implementations of the
equlas()- and hash()-method.-noValueCtor is not given:
The generated class will provide a value constructor, which offers a
parameter list corresponding to the elements of the structure.generateJavaFile in class JrpcgenComplexTypepublic String toString()
public void dump()
System.out.public <T extends Appendable> T dump(T appendable)
Appendable.T - A type extending or implementing the interface java.lang.Appendable.appendable - An object of type TCopyright © 2025. All rights reserved.