Package org.acplt.oncrpc.apps.jrpcgen
Class JrpcgenConst
- java.lang.Object
-
- org.acplt.oncrpc.apps.jrpcgen.JrpcgenConst
-
public class JrpcgenConst extends java.lang.Object
TheJrpcgenConst
class represents a single constant defined in an rpcgen "x"-file.- Version:
- $Revision: 1.1.1.1 $ $Date: 2003/08/13 12:03:45 $ $State: Exp $ $Locker: $
- Author:
- Harald Albrecht
-
-
Field Summary
Fields Modifier and Type Field Description boolean
dontTraverseAnyMore
Flag indicating whether this constant and its dependencies should be traversed any more.java.lang.String
enclosure
Specifies the enclosure (scope) within the identifier must be addressed for a constant defined by an enumumeration.java.lang.String
identifier
Constant identifier.java.lang.String
value
Contains value (or identifier refering to another constant) of constant.
-
Constructor Summary
Constructors Constructor Description JrpcgenConst(java.lang.String identifier, java.lang.String value)
Constructs aJrpcgenConst
and sets the identifier and the associated value.JrpcgenConst(java.lang.String identifier, java.lang.String value, java.lang.String enclosure)
Constructs aJrpcgenConst
and sets the identifier and the associated value of an enumeration etc.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dump()
Dumps the constant as well as its value toSystem.out
.java.lang.String
getDependencyIdentifier()
Returns the identifier this constant depends on ornull
, if no dependency exists.java.lang.String
resolveValue()
Returns value as integer literal (and thus resolving identifiers recursively, if necessary).
-
-
-
Field Detail
-
identifier
public java.lang.String identifier
Constant identifier.
-
value
public java.lang.String value
Contains value (or identifier refering to another constant) of constant.
-
enclosure
public java.lang.String enclosure
Specifies the enclosure (scope) within the identifier must be addressed for a constant defined by an enumumeration.
-
dontTraverseAnyMore
public boolean dontTraverseAnyMore
Flag indicating whether this constant and its dependencies should be traversed any more.
-
-
Constructor Detail
-
JrpcgenConst
public JrpcgenConst(java.lang.String identifier, java.lang.String value)
Constructs aJrpcgenConst
and sets the identifier and the associated value.- Parameters:
identifier
- Constant identifier to define.value
- Value assigned to constant.
-
JrpcgenConst
public JrpcgenConst(java.lang.String identifier, java.lang.String value, java.lang.String enclosure)
Constructs aJrpcgenConst
and sets the identifier and the associated value of an enumeration etc.- Parameters:
identifier
- Constant identifier to define.value
- Value assigned to constant.enclosure
- Name of enclosing enumeration, etc.
-
-
Method Detail
-
resolveValue
public java.lang.String resolveValue()
Returns value as integer literal (and thus resolving identifiers recursively, if necessary). This is only possible for simple subsitutions, that is A is defined as B, B as C, and C as 42, thus A is eventually defined as 42.This simple kind of resolving is necessary when defining a particular version of an ONC/RPC protocol. We need to be able to resolve the version to an integer literal because we need to append the version number to any remote procedure defined to avoid identifier clashes if the same remote procedure is defined for several versions.
- Returns:
- integer literal as
String
ornull
, if the identifier could not be resolved to an integer literal.
-
getDependencyIdentifier
public java.lang.String getDependencyIdentifier()
Returns the identifier this constant depends on ornull
, if no dependency exists.- Returns:
- dependency identifier or
null
.
-
dump
public void dump()
Dumps the constant as well as its value toSystem.out
.
-
-