Package org.acplt.oncrpc.apps.jrpcgen
Class JrpcgenStruct
java.lang.Object
org.acplt.oncrpc.apps.jrpcgen.JrpcgenDocumentable
org.acplt.oncrpc.apps.jrpcgen.JrpcgenXdrDefinition
org.acplt.oncrpc.apps.jrpcgen.JrpcgenComplexType
org.acplt.oncrpc.apps.jrpcgen.JrpcgenStruct
- All Implemented Interfaces:
JrpcgenItem,JrpcgenTypeMapping
The
JrpcgenStruct class represents a single structure defined
in an rpcgen "x"-file.- Version:
- $Revision: 1.1 $ $Date: 2003/08/13 12:03:47 $ $State: Exp $ $Locker: $
- Author:
- Harald Albrecht
-
Nested Class Summary
Nested classes/interfaces inherited from class org.acplt.oncrpc.apps.jrpcgen.JrpcgenXdrDefinition
JrpcgenXdrDefinition.Table, JrpcgenXdrDefinition.Type -
Field Summary
Fields inherited from class org.acplt.oncrpc.apps.jrpcgen.JrpcgenDocumentable
documentation -
Constructor Summary
ConstructorsConstructorDescriptionJrpcgenStruct(JrpcgenContext context, String identifier, JrpcgenDeclaration.Table elements) Constructs aJrpcgenStructand sets the identifier and all its attribute elements. -
Method Summary
Modifier and TypeMethodDescriptionvoiddump()Dumps the structure together with its attribute elements toSystem.out.<T extends Appendable>
Tdump(T appendable) Dumps a description of the structure to the passed target object, which implements the appendable interfaceAppendable.voidGenerates a Java file defining the class, which will represent an XDR struct.final JrpcgenDeclaration.TableReturns the elements of this structure.toString()Returns a string representation of the structure.Methods inherited from class org.acplt.oncrpc.apps.jrpcgen.JrpcgenComplexType
getDefinitionName, getJavaClass, getJavaName, getXdrClass, isBaseType, isBooleanType, isOpaqueType, isStringType, isVoid, writeEqualsExpression, writeJavaToXdr, writeJavaToXdr, writeXdrConstructorCall, writeXdrConstructorCall, writeXdrDecodingCall, writeXdrDynamicVectorDecodingCall, writeXdrDynamicVectorEncodingCall, writeXdrEncodingCall, writeXdrEncodingCall, writeXdrFixedVectorDecodingCall, writeXdrFixedVectorEncodingCall, writeXdrToJava, writeXdrVectorCodingMethodsMethods inherited from class org.acplt.oncrpc.apps.jrpcgen.JrpcgenXdrDefinition
getIdentifier, getXdrType, isConst, isEnum, isStruct, isTypedef, isUnionMethods inherited from class org.acplt.oncrpc.apps.jrpcgen.JrpcgenDocumentable
appendDeprecatedOrNothing, appendDeprecatedOrNothing, documentationIsEmpty, documentationIsProvided, emptyDocumentation, getDocumentation, getIdentedDocu, getIdentedDocu, isDeprecated, writeDocumentation, writeDocumentation
-
Constructor Details
-
JrpcgenStruct
Constructs aJrpcgenStructand sets the identifier and all its attribute elements.- Parameters:
context- The context the new struct belongs to.identifier- Identifier to be declared.elements- Table of declarations based on classJrpcgenDeclaration.
-
-
Method Details
-
getElements
Returns the elements of this structure.- Returns:
- The elements of this structure.
-
generateJavaFile
public void generateJavaFile()Generates a Java file defining the class, which will represent an XDR struct. The generated class will implement the interface.invalid reference
XdrAbleAt 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:
- The option
-ser(serializable) is given: The generated class will implement the interfaceinvalid reference
Serializable - The option
-beanis 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. - The option
-noToStringis not given: The generated class will provide an own implementation of thetoString()-method. - The option
-noEqualsis not given: The generated class will provide own implementations of theequlas()- andhash()-method. - The option
-noValueCtoris not given: The generated class will provide a value constructor, which offers a parameter list corresponding to the elements of the structure.
- Specified by:
generateJavaFilein classJrpcgenComplexType
- The option
-
toString
Returns a string representation of the structure. -
dump
public void dump()Dumps the structure together with its attribute elements toSystem.out. -
dump
Dumps a description of the structure to the passed target object, which implements the appendable interfaceAppendable.- Type Parameters:
T- A type extending or implementing the interfacejava.lang.Appendable.- Parameters:
appendable- An object of typeT- Returns:
- The passed object with a dump of this structure appended.
-