Package org.acplt.oncrpc.apps.jrpcgen

# Class JrpcgenUnion

java.lang.Object
org.acplt.oncrpc.apps.jrpcgen.JrpcgenDocumentable
org.acplt.oncrpc.apps.jrpcgen.JrpcgenXdrDefinition
org.acplt.oncrpc.apps.jrpcgen.JrpcgenComplexType
org.acplt.oncrpc.apps.jrpcgen.JrpcgenUnion

All Implemented Interfaces:
  `JrpcgenItem`, `JrpcgenTypeMapping`

public class JrpcgenUnion extends JrpcgenComplexType
The `JrpcgenUnion` class represents a single union defined in an rpcgen "x"-file.

Version:
  $Revision: 1.1 $ $Date: 2003/08/13 12:03:47 $ $State: Exp $ $Locker: $
Author:
  Harald Albrecht

## Nested Class Summary

## Nested classes/interfaces inherited from class org.acplt.oncrpc.apps.jrpcgen.JrpcgenXdrDefinition

`JrpcgenXdrDefinition.Table, JrpcgenXdrDefinition.Type`

## Field Summary

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

`documentation`

## Constructor Summary

Constructors
Constructor
Description
`JrpcgenUnion(JrpcgenContext context, String identifier, JrpcgenDeclaration discriminant, Vector<JrpcgenUnionArm> elements)`
Constructs a `JrpcgenUnion` and sets the identifier, the descrimant element as well as all attribute elements.

## Method Summary

Modifier and Type
Method
Description
`void`
`dump()`
Dumps the union together with its attribute elements end the descriminant to `System.out`.
`<T extends Appendable>
T`
`dump(T appendable)`
`void`
`generateJavaFile()`
Concrete implementations are asked to generate a Java file containing an implementation of the Java class mapping the complex type.
`final JrpcgenDeclaration`
`getDiscriminant()`
`final Vector<JrpcgenUnionArm>`
`getElements()`
`String`
`toString()`
Returns just the identifier.

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

`getDefinitionName, getJavaClass, getJavaName, getXdrClass, isBaseType, isBooleanType, isOpaqueType, isStringType, isVoid, writeEqualsExpression, writeJavaToXdr, writeJavaToXdr, writeXdrConstructorCall, writeXdrConstructorCall, writeXdrDecodingCall, writeXdrDynamicVectorDecodingCall, writeXdrDynamicVectorEncodingCall, writeXdrEncodingCall, writeXdrEncodingCall, writeXdrFixedVectorDecodingCall, writeXdrFixedVectorEncodingCall, writeXdrToJava, writeXdrVectorCodingMethods`

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

`getIdentifier, getXdrType, isConst, isEnum, isStruct, isTypedef, isUnion`

### 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

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

## Constructor Details

### JrpcgenUnion

public JrpcgenUnion(JrpcgenContext context, String identifier, JrpcgenDeclaration discriminant, Vector<JrpcgenUnionArm> elements)
Constructs a `JrpcgenUnion` and sets the identifier, the descrimant element as well as all attribute elements.

Parameters:
  `context` - The context the nwe union belongs to.
  `identifier` - Identifier to be declared.
  `discriminant` - Discriminant element of class `JrpcgenDeclaration`.
  `elements` - Vector of atrribute elements of class `JrpcgenDeclaration`.

## Method Details

### toString

public String toString()
Returns just the identifier.

Overrides:
  `toString` in class `Object`

### getDiscriminant

public final JrpcgenDeclaration getDiscriminant()

### getElements

public final Vector<JrpcgenUnionArm> getElements()

### generateJavaFile

public void generateJavaFile()
Description copied from class: `JrpcgenComplexType`
Concrete implementations are asked to generate a Java file containing an implementation of the Java class mapping the complex type.

Specified by:
  `generateJavaFile` in class `JrpcgenComplexType`

### dump

public void dump()
Dumps the union together with its attribute elements end the descriminant to `System.out`.

### dump

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