public class JrpcgenConst extends Object
JrpcgenConst
class represents a single constant defined
in an rpcgen "x"-file.Modifier and Type | Field and Description |
---|---|
boolean |
dontTraverseAnyMore
Flag indicating whether this constant and its dependencies should be
traversed any more.
|
String |
enclosure
Specifies the enclosure (scope) within the identifier must be
addressed for a constant defined by an enumumeration.
|
String |
identifier
Constant identifier.
|
String |
value
Contains value (or identifier refering to another constant) of constant.
|
Constructor and Description |
---|
JrpcgenConst(String identifier,
String value)
Constructs a
JrpcgenConst and sets the identifier and
the associated value. |
JrpcgenConst(String identifier,
String value,
String enclosure)
Constructs a
JrpcgenConst and sets the identifier and
the associated value of an enumeration etc. |
Modifier and Type | Method and Description |
---|---|
void |
dump()
Dumps the constant as well as its value to
System.out . |
String |
getDependencyIdentifier()
Returns the identifier this constant depends on or
null ,
if no dependency exists. |
String |
resolveValue()
Returns value as integer literal (and thus resolving identifiers
recursively, if necessary).
|
public String identifier
public String value
public String enclosure
public boolean dontTraverseAnyMore
public JrpcgenConst(String identifier, String value)
JrpcgenConst
and sets the identifier and
the associated value.identifier
- Constant identifier to define.value
- Value assigned to constant.public JrpcgenConst(String identifier, String value, String enclosure)
JrpcgenConst
and sets the identifier and
the associated value of an enumeration etc.identifier
- Constant identifier to define.value
- Value assigned to constant.enclosure
- Name of enclosing enumeration, etc.public String resolveValue()
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.
String
or null
,
if the identifier could not be resolved to an integer literal.public String getDependencyIdentifier()
null
,
if no dependency exists.null
.public void dump()
System.out
.Copyright © 2022. All rights reserved.