public enum JrpcgenBaseType extends Enum<JrpcgenBaseType> implements JrpcgenTypeMapping
| Enum Constant and Description |
|---|
BOOL |
CHAR |
DOUBLE |
FLOAT |
HYPER |
INT |
OPAQUE |
SHORT |
STRING |
VOID |
| Modifier and Type | Method and Description |
|---|---|
static JrpcgenBaseType |
getBaseType(String type)
Returns the base type mapping to the passed type name as given
in an x-file.
|
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 name of the Java type mapped to the XDR type identified
by the definition name.
|
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.
|
static boolean |
isBaseType(String type)
Returns whether the passed type name labels one of the base
types defined by this enumeration.
|
static boolean |
isBoolean(String type)
Returns whether the passed type name equals the definition name
of the base type
bool. |
boolean |
isBooleanType()
Returns whether this base type maps the type
boolean. |
static boolean |
isChar(String type)
Returns whether the passed type name equals the definition name
of the base type
char. |
static boolean |
isDouble(String type)
Returns whether the passed type name equals the definition name
of the base type
double. |
static boolean |
isFloat(String type)
Returns whether the passed type name equals the definition name
of the base type
float. |
static boolean |
isHyper(String type)
Returns whether the passed type name equals the definition name
of the base type
hyper. |
static boolean |
isInt(String type)
Returns whether the passed type name equals the definition name
of the base type
int. |
static boolean |
isOpaque(String type)
Returns whether the passed type name equals the definition name
of the base type
opaque. |
boolean |
isOpaqueType()
Returns whether this base type maps the type
opaque. |
static boolean |
isPrimitive(String type)
Returns whether the passed type name labels the definition name
of one of the primitive types
bool, char,
short, int, hyper, float or
double. |
static boolean |
isShort(String type)
Returns whether the passed type name equals the definition name
of the base type
short. |
static boolean |
isString(String type)
Returns whether the passed type name equals the definition name
of the base type
String. |
boolean |
isStringType()
Returns whether this base type maps the type
String. |
boolean |
isVoid()
Returns whether this base type maps the type
void. |
static boolean |
isVoid(String type)
Returns whether the passed type name equals the definition name
of the base type
void. |
static JrpcgenBaseType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static JrpcgenBaseType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
JrpcgenJavaFile |
writeCodingMethodStem(JrpcgenJavaFile javaFile,
String xdrStream,
String codingType,
String typeSpecifier)
Writes the coding method stem for the mapped base type.
|
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 cosntuctor call based on the XDR class of the mapped base 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 base 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 result)
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 final JrpcgenBaseType VOID
public static final JrpcgenBaseType BOOL
public static final JrpcgenBaseType CHAR
public static final JrpcgenBaseType SHORT
public static final JrpcgenBaseType INT
public static final JrpcgenBaseType HYPER
public static final JrpcgenBaseType FLOAT
public static final JrpcgenBaseType DOUBLE
public static final JrpcgenBaseType STRING
public static final JrpcgenBaseType OPAQUE
public static JrpcgenBaseType[] values()
for (JrpcgenBaseType c : JrpcgenBaseType.values()) System.out.println(c);
public static JrpcgenBaseType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static boolean isVoid(String type)
void.type - The type name to check.true in case the passed type name equals the definition
name of the base type void, false otherwise.public static boolean isBoolean(String type)
bool.type - The type name to check.true in case the passed type name equals the definition
name of the base type bool, false otherwise.public static boolean isChar(String type)
char.type - The type name to check.true in case the passed type name equals the definition
name of the base type char, false otherwise.public static boolean isShort(String type)
short.type - The type name to check.true in case the passed type name equals the definition
name of the base type short, false otherwise.public static boolean isInt(String type)
int.type - The type name to check.true in case the passed type name equals the definition
name of the base type int, false otherwise.public static boolean isHyper(String type)
hyper.type - The type name to check.true in case the passed type name equals the definition
name of the base type hyper, false otherwise.public static boolean isFloat(String type)
float.type - The type name to check.true in case the passed type name equals the definition
name of the base type float, false otherwise.public static boolean isDouble(String type)
double.type - The type name to check.true in case the passed type name equals the definition
name of the base type double, false otherwise.public static boolean isString(String type)
String.type - The type name to check.true in case the passed type name equals the definition
name of the base type String, false otherwise.public static boolean isOpaque(String type)
opaque.type - The type name to check.true in case the passed type name equals the definition
name of the base type opaque, false otherwise.public static boolean isPrimitive(String type)
bool, char,
short, int, hyper, float or
double.type - The type name to check.true in case the passed type name labels one of
the mentioned primitive types, false otherwise.public static boolean isBaseType(String type)
type - The type name to check.true in case the passed type name labels one
of the base types defined by this enumeration,
false otherwise.public static JrpcgenBaseType getBaseType(String type)
JrpcgenBaseType.VOIDJrpcgenBaseType.BOOLJrpcgenBaseType.CHARJrpcgenBaseType.SHORTJrpcgenBaseType.INTJrpcgenBaseType.HYPERJrpcgenBaseType.FLOATJrpcgenBaseType.DOUBLEJrpcgenBaseType.STRINGJrpcgenBaseType.OPAQUEtype - The name of the requested base type.null.public final boolean isVoid()
void.isVoid in interface JrpcgenTypeMappingtrue in case this is the mapping for type
void, false otherwise.public final boolean isBaseType()
true is returned, always.isBaseType in interface JrpcgenTypeMappingtruepublic final boolean isBooleanType()
boolean.isBooleanType in interface JrpcgenTypeMappingtrue in case this is the mapping for type
boolean…, false otherwise.public final boolean isStringType()
String.isStringType in interface JrpcgenTypeMappingtrue in case this base type maps the type
String, false otherwise.public final boolean isOpaqueType()
opaque.isOpaqueType in interface JrpcgenTypeMappingtrue in case this base type maps the type
opaque, false otherwise.public final String getDefinitionName()
JrpcgenBaseType.VOID returns the name void.JrpcgenBaseType.BOOL returns the name boolJrpcgenBaseType.CHAR returns the name charJrpcgenBaseType.SHORT returns the name shortJrpcgenBaseType.INT returns the name intJrpcgenBaseType.HYPER returns the name hyperJrpcgenBaseType.FLOAT returns the name floatJrpcgenBaseType.DOUBLE returns the name doubleJrpcgenBaseType.STRING returns the name stringJrpcgenBaseType.OPAQUE returns the name opaquegetDefinitionName in interface JrpcgenTypeMappingpublic final String getJavaName()
void for the base type mapping JrpcgenBaseType.VOID.boolean for the base type mapping JrpcgenBaseType.BOOL.byte for the base type mapping JrpcgenBaseType.CHAR.short for the base type mapping JrpcgenBaseType.SHORT.int for the base type mapping JrpcgenBaseType.INT.long for the base type mapping JrpcgenBaseType.HYPER.float for the base type mapping JrpcgenBaseType.FLOAT.double for the base type mapping JrpcgenBaseType.DOUBLE.String for the base type mapping JrpcgenBaseType.STRING.byte for the base type mapping JrpcgenBaseType.OPAQUE.getJavaName in interface JrpcgenTypeMappingpublic final String getJavaClass()
Void for the base type mapping JrpcgenBaseType.VOID.Boolean for the base type mapping JrpcgenBaseType.BOOL.Byte for the base type mapping JrpcgenBaseType.CHAR.Short for the base type mapping JrpcgenBaseType.SHORT.Integer for the base type mapping JrpcgenBaseType.INT.Long for the base type mapping JrpcgenBaseType.HYPER.Float for the base type mapping JrpcgenBaseType.FLOAT.Double for the base type mapping JrpcgenBaseType.DOUBLE.String for the base type mapping JrpcgenBaseType.STRING.Byte for the base type mapping JrpcgenBaseType.OPAQUE.getJavaClass in interface JrpcgenTypeMappingpublic final String getXdrClass()
XdrAble for the mapped type. The returned value depends on the
mapped base type and will be one of the following:
XdrVoid for the base type mapping JrpcgenBaseType.VOID.XdrBoolean for the base type mapping JrpcgenBaseType.BOOL.XdrByte for the base type mapping JrpcgenBaseType.CHAR.XdrShort for the base type mapping JrpcgenBaseType.SHORT.XdrInt for the base type mapping JrpcgenBaseType.INT.XdrLong for the base type mapping JrpcgenBaseType.HYPER.XdrFloat for the base type mapping JrpcgenBaseType.FLOAT.XdrDouble for the base type mapping JrpcgenBaseType.DOUBLE.XdrString for the base type mapping JrpcgenBaseType.STRING.XdrOpaque for the base type mapping JrpcgenBaseType.OPAQUE.getXdrClass in interface JrpcgenTypeMappingpublic void writeXdrConstructorCall(JrpcgenJavaFile javaFile, String parameter)
This applies to all base types except for the base type
JrpcgenBaseType.VOID. The base type JrpcgenBaseType.VOID
will return a reference to the global instance XdrVoid.XDR_VOID,
always. As this type does not hold a value, a passed parameter different
from null will be ignored.
writeXdrConstructorCall 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 void writeXdrConstructorCall(JrpcgenJavaFile javaFile, JrpcgenJavaFile.Expression parameterExpression)
This applies to all base types except for the base type
JrpcgenBaseType.VOID. The base type JrpcgenBaseType.VOID
will return a reference to the global instance XdrVoid.XDR_VOID,
always. As this type does not hold a value, the passed parameter expression
will be ignored.
writeXdrConstructorCall in interface JrpcgenTypeMappingjavaFile - The Java file, where the constructor 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 void writeJavaToXdr(JrpcgenJavaFile javaFile, String variable)
writeJavaToXdr in interface JrpcgenTypeMappingjavaFile - The java file, where the converison statement is going to be placed.variable - The name of a variable in Java representation.writeXdrConstructorCall(JrpcgenJavaFile, String)public void writeJavaToXdr(JrpcgenJavaFile javaFile, JrpcgenJavaFile.Expression expression)
writeJavaToXdr 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.writeXdrConstructorCall(JrpcgenJavaFile, org.acplt.oncrpc.apps.jrpcgen.JrpcgenJavaFile.Expression)public void writeXdrToJava(JrpcgenJavaFile javaFile, String result)
This applies to all base types except for the base type
JrpcgenBaseType.VOID. No statement is written for this
type, becaus the XDR class XdrVoid does not hold any value.
writeXdrToJava 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 void writeXdrEncodingCall(JrpcgenJavaFile javaFile, String xdrStream, String variable)
This applies to all base types except for the following base types:
JrpcgenBaseType.VOID : This type does not support any coding as it
does represent no value.JrpcgenBaseType.STRING : This type does not support coding in a
scalar context.JrpcgenBaseType.OPAQUE : This type does not support coding in a
scalar context.writeXdrEncodingCall 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 void writeXdrEncodingCall(JrpcgenJavaFile javaFile, String xdrStream, JrpcgenJavaFile.Expression expression)
This applies to all base types except for the following base types:
JrpcgenBaseType.VOID : This type does not support any coding as it
does represent no value.JrpcgenBaseType.STRING : This type does not support coding in a
scalar context.JrpcgenBaseType.OPAQUE : This type does not support coding in a
scalar context.writeXdrEncodingCall 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 void writeXdrFixedVectorEncodingCall(JrpcgenJavaFile javaFile, String xdrStream, String variable, String size)
This applies to all base types except for the following base types:
JrpcgenBaseType.VOID : This type does not support any coding as it
does represent no value.JrpcgenBaseType.STRING : This type does not support coding in
a fixed vector context.writeXdrFixedVectorEncodingCall 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 void writeXdrDynamicVectorEncodingCall(JrpcgenJavaFile javaFile, String xdrStream, String variable)
This applies to all base types except for the base type
JrpcgenBaseType.VOID, which does not support any coding as it does
represent no value. Consequently, nothing is written to the passed Java file
by this method for the base type JrpcgenBaseType.VOID.
writeXdrDynamicVectorEncodingCall 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 void writeXdrDecodingCall(JrpcgenJavaFile javaFile, String xdrStream)
This applies to all base types except for the following base types:
JrpcgenBaseType.VOID : This type does not support any coding as it
does represent no value.JrpcgenBaseType.STRING : This type does not support coding in a
scalar context.JrpcgenBaseType.OPAQUE : This type does not support coding in a
scalar context.writeXdrDecodingCall 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 void writeXdrFixedVectorDecodingCall(JrpcgenJavaFile javaFile, String xdrStream, String size)
This applies to all base types except for the following base types:
JrpcgenBaseType.VOID : This type does not support any coding as it
does represent no value.JrpcgenBaseType.STRING : This type does not support coding in
a fixed vector context.writeXdrFixedVectorDecodingCall 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 void writeXdrDynamicVectorDecodingCall(JrpcgenJavaFile javaFile, String xdrStream)
This applies to all base types except for the base type
JrpcgenBaseType.VOID, which does not support any coding as it does
represent no value. Consequently, nothing is written to the passed Java file
by this method for the base type JrpcgenBaseType.VOID.
writeXdrDynamicVectorDecodingCall 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 void writeEqualsExpression(JrpcgenJavaFile javaFile, String variableLeft, String variableRight, boolean negate)
true on equality or on inequality.
This applies to all base types except for the base type
JrpcgenBaseType.VOID, for which nothing is written to the
passed Java file by ths method.
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.public JrpcgenJavaFile writeCodingMethodStem(JrpcgenJavaFile javaFile, String xdrStream, String codingType, String typeSpecifier)
javaFile - The Java file where the method stem is going to be placed.xdrStream - The name of the XDR coding stream.codingType - The coding type to use, xdrEncode or xdrDecode in most
of the cases.typeSpecifier - The type specifier to append to the coding type, either the Java name
or the definition name in most of the cases.Copyright © 2025. All rights reserved.