public class JrpcgenTypeInfo extends Object implements JrpcgenTypeMapping
| Modifier and Type | Method and Description |
|---|---|
static void |
generateCodingSupplement(JrpcgenContext context) |
String |
getDefinitionName()
Returns the definition name of the mapped type in the x-file.
|
String |
getJavaClass()
Returns the name of the Java class belonging to the mapped type.
|
String |
getJavaName()
Returns the Java name of the mapped type.
|
static JrpcgenTypeInfo |
getTypeInfo(JrpcgenContext context,
String type) |
String |
getXdrClass()
Returns the name of the XDR class providing the coding methods
of the mapped type, in detail the class implementing the interface
XdrAble for the mapped type. |
boolean |
isBaseType()
Returns whether the mapped type belongs to the family of
the base types.
|
boolean |
isBooleanType()
Returns whether the mapped type is
boolean. |
boolean |
isOpaqueType()
Returns whether the mapped type is
opaque. |
boolean |
isStringType()
Returns whether the mapped type is
String. |
boolean |
isVoid()
Returns whether the mapped type is
void. |
void |
writeEqualsExpression(JrpcgenJavaFile javaFile,
String variableLeft,
String variableRight,
boolean negate)
Writes an equals expression to the passed Java file using the passed names of a left hand side
and a right hand side variable.
|
void |
writeJavaToXdr(JrpcgenJavaFile javaFile,
JrpcgenJavaFile.Expression expression)
Writes a conversion statement to the passed Java file changing the Java representation
resulting from the passed expression to the corresponding XDR representation, in order
to enable XDR encoding operations on the result of the passed expression.
|
void |
writeJavaToXdr(JrpcgenJavaFile javaFile,
String variable)
Writes a conversion statement to the passed Java file changing the Java representation
of a variable to the corresponding XDR representation, in order to enable XDR encoding
operations on the referenced variable.
|
void |
writeXdrConstructorCall(JrpcgenJavaFile javaFile,
JrpcgenJavaFile.Expression parameterExpression)
A constructor call based on the XDR class of the mapped type is written to
the passed Java file.
|
void |
writeXdrConstructorCall(JrpcgenJavaFile javaFile,
String parameter)
A constructor call based on the XDR class of the mapped type is written to
the passed Java file.
|
void |
writeXdrDecodingCall(JrpcgenJavaFile javaFile,
String xdrStream)
Writes an XDR decoding call to the passed Java file using the passed name of an XDR decoding
stream.
|
void |
writeXdrDynamicVectorDecodingCall(JrpcgenJavaFile javaFile,
String xdrStream)
Writes an XDR decoding call for a dynamic vector to the passed Java file using the passed
name of an XDR decoding stream.
|
void |
writeXdrDynamicVectorEncodingCall(JrpcgenJavaFile javaFile,
String xdrStream,
String variable)
Writes an XDR encoding call for a dynamic vector to the passed Java file using the passed
name of an XDR encoding stream and the passed name of a variable.
|
void |
writeXdrEncodingCall(JrpcgenJavaFile javaFile,
String xdrStream,
JrpcgenJavaFile.Expression expression)
Writes an XDR encoding call to the passed Java file using the passed name of an
XDR encoding stream and the result of the passed experssion.
|
void |
writeXdrEncodingCall(JrpcgenJavaFile javaFile,
String xdrStream,
String variable)
Writes an XDR encoding call to the passed Java file using the passed name of an
XDR encoding stream and the passed name of a variable.
|
void |
writeXdrFixedVectorDecodingCall(JrpcgenJavaFile javaFile,
String xdrStream,
String size)
Writes an XDR decoding call for a fixed vector to the passed Java file using the passed name
of an XDR decoding stream and the passed size.
|
void |
writeXdrFixedVectorEncodingCall(JrpcgenJavaFile javaFile,
String xdrStream,
String variable,
String size)
Writes an XDR encoding call for a fixed vector to the passed Java file using the passed
name of an XDR encoding stream, the passed name of a variable and the passed size.
|
void |
writeXdrToJava(JrpcgenJavaFile javaFile,
String variable)
Writes a conversion statement to the passed Java file changing the XDR representation
of a variable to the corresponding Java representation, which takes place after
XDR decoding operations.
|
public static JrpcgenTypeInfo getTypeInfo(JrpcgenContext context, String type)
public static void generateCodingSupplement(JrpcgenContext context)
public final boolean isVoid()
JrpcgenTypeMappingvoid.isVoid in interface JrpcgenTypeMappingtrue in case the mapped type is
void, false otherwise.public final boolean isBaseType()
JrpcgenTypeMappingvoidbooleanbyteshortintlongfloatdoubleStringopaqueJrpgenBaseType.isBaseType in interface JrpcgenTypeMappingtrue in case the mapped type belongs to the family
of base types, false otherwise.public final boolean isBooleanType()
JrpcgenTypeMappingboolean.isBooleanType in interface JrpcgenTypeMappingtrue in case the mapped type is boolean,
false otherwise.public final boolean isStringType()
JrpcgenTypeMappingString.isStringType in interface JrpcgenTypeMappingtrue in case the mapped type is String,
false otherwise.public final boolean isOpaqueType()
JrpcgenTypeMappingopaque.isOpaqueType in interface JrpcgenTypeMappingtrue in case the mapped type is opaque,
false otherwise.public final String getDefinitionName()
JrpcgenTypeMappinggetDefinitionName in interface JrpcgenTypeMappingpublic final String getJavaName()
JrpcgenTypeMappinggetJavaName in interface JrpcgenTypeMappingpublic final String getJavaClass()
JrpcgenTypeMappingint,
this method is expected to return the name of the wrapper class
to the Java primitive.getJavaClass in interface JrpcgenTypeMappingpublic final String getXdrClass()
JrpcgenTypeMappingXdrAble for the mapped type. For base types the returned
value will be one of the provided XDR classes of the ONC/RPC runtime
library. For enumerations the returned value depends on the given
value to the flag noEnum. However, the returned value identifies
an XDR class provided by the ONC/RPC runtime library, in detail either
XdrInt with flag noEnum set to true or
XdrEnum with flag noEnum set to false.
For other complex types the returned value will be equal to the Java name
and Java class, respectively.getXdrClass in interface JrpcgenTypeMappingpublic final void writeXdrConstructorCall(JrpcgenJavaFile javaFile, String parameter)
JrpcgenTypeMappingwriteXdrConstructorCall in interface JrpcgenTypeMappingjavaFile - The Java file, where the XDR constructor call is going to be placed.parameter - null to generate a default constructor call, a parameter
name to generate a constructor call with one parameter.public final void writeXdrConstructorCall(JrpcgenJavaFile javaFile, JrpcgenJavaFile.Expression parameterExpression)
JrpcgenTypeMappingwriteXdrConstructorCall in interface JrpcgenTypeMappingjavaFile - The Java file, where the constuctor call is going to be placed.parameterExpression - An expression to be called with the passed Java file,
when the expression is going to be placed in the Java file.public final void writeJavaToXdr(JrpcgenJavaFile javaFile, String variable)
JrpcgenTypeMappingwriteJavaToXdr in interface JrpcgenTypeMappingjavaFile - The java file, where the converison statement is going to be placed.variable - The name of a variable in Java representation.public final void writeJavaToXdr(JrpcgenJavaFile javaFile, JrpcgenJavaFile.Expression expression)
JrpcgenTypeMappingwriteJavaToXdr in interface JrpcgenTypeMappingjavaFile - The Java file, where the conversion statement is going to be placed.expression - An expression to be called with the passed Java file, when the
expression is going to be placed in the Java file.public final void writeXdrToJava(JrpcgenJavaFile javaFile, String variable)
JrpcgenTypeMappingwriteXdrToJava in interface JrpcgenTypeMappingjavaFile - The Java file, where the conversion statement is going to be placed.variable - The name of a variable in XDR representation.public final void writeXdrEncodingCall(JrpcgenJavaFile javaFile, String xdrStream, String variable)
JrpcgenTypeMappingwriteXdrEncodingCall in interface JrpcgenTypeMappingjavaFile - The Java file, where the XDR encoding call is going to be placed.xdrStream - The name of the XDR encoding stream instance to be used in the statement.variable - The name of the variable to be used in the statement.public final void writeXdrEncodingCall(JrpcgenJavaFile javaFile, String xdrStream, JrpcgenJavaFile.Expression expression)
JrpcgenTypeMappingwriteXdrEncodingCall in interface JrpcgenTypeMappingjavaFile - The Java file, where the XDR encoding code is going to be placed.xdrStream - The name of the XDR encoding stream instance to be used in the statement.expression - An expression to be called with the passed Java file, when the
expression is going to be placed in the Java file.public final void writeXdrFixedVectorEncodingCall(JrpcgenJavaFile javaFile, String xdrStream, String variable, String size)
JrpcgenTypeMappingwriteXdrFixedVectorEncodingCall in interface JrpcgenTypeMappingjavaFile - The Java file, where the XDR encoding call is going to be placed.xdrStream - The name of the XDR encoding stream instance to be used in the statement.variable - The name of the variable to be used in the statement.size - A string specifying the size of the fixed vector.public final void writeXdrDynamicVectorEncodingCall(JrpcgenJavaFile javaFile, String xdrStream, String variable)
JrpcgenTypeMappingwriteXdrDynamicVectorEncodingCall in interface JrpcgenTypeMappingjavaFile - The Java file, where the XDR encoding call is going to be placed.xdrStream - The name of the XDR encoding stream instance to be used in the statement.variable - The name of the variable to be used in the statement.public final void writeXdrDecodingCall(JrpcgenJavaFile javaFile, String xdrStream)
JrpcgenTypeMappingwriteXdrDecodingCall in interface JrpcgenTypeMappingjavaFile - The Java file, where the XDR decoding call is going to be placed.xdrStream - The name of the XDR decoding stream instance to be used in the statement.public final void writeXdrFixedVectorDecodingCall(JrpcgenJavaFile javaFile, String xdrStream, String size)
JrpcgenTypeMappingwriteXdrFixedVectorDecodingCall in interface JrpcgenTypeMappingjavaFile - The Java file, where the XDR decoding call is going to be placed.xdrStream - The name of the XDR decoding stream instance to be used in the statement.size - A string specifying the size of the fixed vector.public final void writeXdrDynamicVectorDecodingCall(JrpcgenJavaFile javaFile, String xdrStream)
JrpcgenTypeMappingwriteXdrDynamicVectorDecodingCall in interface JrpcgenTypeMappingjavaFile - The Java file, where the XDR decoding call is going to be placed.xdrStream - The name of the XDR decoding stream instance to be used in the statement.public final void writeEqualsExpression(JrpcgenJavaFile javaFile, String variableLeft, String variableRight, boolean negate)
JrpcgenTypeMappingtrue on equality or on inequality.writeEqualsExpression in interface JrpcgenTypeMappingjavaFile - The Java file, where the equality expression is going to be placed.variableLeft - The name of the variable to be used as the left hand side in the statement.variableRight - The name of the variable to be used as the right hand side in the statement.negate - false to let the resulting statement return true on equality,
true to let the resulting statement return true on inequality.Copyright © 2025. All rights reserved.