Package org.acplt.oncrpc.apps.jrpcgen

# Class JrpcgenDeclaration

java.lang.Object
org.acplt.oncrpc.apps.jrpcgen.JrpcgenDocumentable
org.acplt.oncrpc.apps.jrpcgen.JrpcgenDeclaration

All Implemented Interfaces:
  `Cloneable`, `JrpcgenItem`

public class JrpcgenDeclaration extends JrpcgenDocumentable implements JrpcgenItem, Cloneable
The `JrpcgenDeclaration` class represents a single declaration from an rpcgen "x"-file.

Version:
  $Revision: 1.2 $ $Date: 2003/08/14 08:08:34 $ $State: Exp $ $Locker: $
Author:
  Harald Albrecht

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`JrpcgenDeclaration.Kind`
`static class`
`JrpcgenDeclaration.Table`

## Field Summary

### Fields inherited from class org.acplt.oncrpc.apps.jrpcgen.JrpcgenDocumentable

`documentation`

## Constructor Summary

Constructors
Constructor
Description
`JrpcgenDeclaration(String identifier, JrpcgenTypeMapping typeMapping)`
Constructs a `JrpcgenDeclaration` and sets the identifier and its data type.
`JrpcgenDeclaration(String identifier, JrpcgenTypeMapping typeMapping, JrpcgenDeclaration.Kind kind, String size)`
Constructs a `JrpcgenDeclaration` and sets the identifier, its data type, kind and size of vector.

## Method Summary

Modifier and Type
Method
Description
`Object`
`clone()`
Clones declaration object.
`void`
`dump()`
Dumps the declaration to `System.out`.
`<T extends Appendable>
T`
`dump(T appendable)`
`final String`
`getIdentifier()`
Delivers the identifier of this item.
`final String`
`getJavaType()`
`final JrpcgenDeclaration.Kind`
`getKind()`
`final String`
`getSize()`
`final String`
`getType()`
`final JrpcgenTypeMapping`
`getTypeMapping()`
`boolean`
`isArray()`
`String`
`toString()`
Returns the identifier.
`void`
`updateHash(JrpcgenSHA hash)`
`void`
`writeDecodingPart(JrpcgenJavaFile javaFile, String enclosure, String oref, JrpcgenContext context)`
`void`
`writeDecodingPart(JrpcgenJavaFile javaFile, String enclosure, JrpcgenContext context)`
`void`
`writeEncodingPart(JrpcgenJavaFile javaFile, String enclosure, String oref, JrpcgenContext context)`
`void`
`writeEncodingPart(JrpcgenJavaFile javaFile, String enclosure, JrpcgenContext context)`
`void`
`writeEqualsExpression(JrpcgenJavaFile javaFile, boolean negate, JrpcgenContext context)`
`void`
`writeEqualsPart(JrpcgenJavaFile javaFile, JrpcgenContext context)`
`void`
`writeGettersAndSetters(JrpcgenJavaFile javaFile)`
`void`
`writeMemberDeclaration(JrpcgenJavaFile javaFile, String access, boolean initString)`
`void`
`writeToStringPart(JrpcgenJavaFile javaFile)`

### Methods inherited from class org.acplt.oncrpc.apps.jrpcgen.JrpcgenDocumentable

`appendDeprecatedOrNothing, appendDeprecatedOrNothing, documentationIsEmpty, documentationIsProvided, emptyDocumentation, getDocumentation, getIdentedDocu, getIdentedDocu, isDeprecated, writeDocumentation, writeDocumentation`

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### JrpcgenDeclaration

public JrpcgenDeclaration(String identifier, JrpcgenTypeMapping typeMapping)
Constructs a `JrpcgenDeclaration` and sets the identifier and its data type. The `kind` of the declaration is assumed to be
invalid reference

    JrpcgenDeclaration#SCALAR

.

Parameters:
  `identifier` - Identifier to be declared.
  `type` - Data type the identifier is declared of.

### JrpcgenDeclaration

public JrpcgenDeclaration(String identifier, JrpcgenTypeMapping typeMapping, JrpcgenDeclaration.Kind kind, String size)
Constructs a `JrpcgenDeclaration` and sets the identifier, its data type, kind and size of vector. This constructur is typically used when declaring either fixed-size or dynamic arrays.

Parameters:
  `identifier` - Identifier to be declared.
  `kind` - Kind of declaration (scalar, vector, indirection).
  `size` - Size of array (if fixed-sized or bounded, otherwise `null`).
  `type` - Data type the identifier is declared of.

## Method Details

### getIdentifier

public final String getIdentifier()
Description copied from interface: `JrpcgenItem`
Delivers the identifier of this item. This value must not be `null`.

Specified by:
  `getIdentifier` in interface `JrpcgenItem`
Returns:
  The idnetifier of this item.

### getType

public final String getType()

### getJavaType

public final String getJavaType()

### getTypeMapping

public final JrpcgenTypeMapping getTypeMapping()

### getKind

public final JrpcgenDeclaration.Kind getKind()

### getSize

public final String getSize()

### updateHash

public void updateHash(JrpcgenSHA hash)

### writeMemberDeclaration

public void writeMemberDeclaration(JrpcgenJavaFile javaFile, String access, boolean initString)

### writeGettersAndSetters

public void writeGettersAndSetters(JrpcgenJavaFile javaFile)

### writeEncodingPart

public void writeEncodingPart(JrpcgenJavaFile javaFile, String enclosure, JrpcgenContext context)

### writeEncodingPart

public void writeEncodingPart(JrpcgenJavaFile javaFile, String enclosure, String oref, JrpcgenContext context)

### writeDecodingPart

public void writeDecodingPart(JrpcgenJavaFile javaFile, String enclosure, JrpcgenContext context)

### writeDecodingPart

public void writeDecodingPart(JrpcgenJavaFile javaFile, String enclosure, String oref, JrpcgenContext context)

### writeToStringPart

public void writeToStringPart(JrpcgenJavaFile javaFile)

### writeEqualsPart

public void writeEqualsPart(JrpcgenJavaFile javaFile, JrpcgenContext context)

### writeEqualsExpression

public void writeEqualsExpression(JrpcgenJavaFile javaFile, boolean negate, JrpcgenContext context)

### toString

public String toString()
Returns the identifier.

Overrides:
  `toString` in class `Object`

### dump

public void dump()
Dumps the declaration to `System.out`.

### dump

public <T extends Appendable> T dump(T appendable)

### clone

public Object clone() throws CloneNotSupportedException
Clones declaration object.

Overrides:
  `clone` in class `Object`
Throws:
  `CloneNotSupportedException`

### isArray

public boolean isArray()

Returns:
  true if the type of this declaration is a java array (string is no java array).