XCMS Toolkit

schemajic.schema
Class ChoiceType

java.lang.Object
  extended by schemajic.schema.Type
      extended by schemajic.schema.ChoiceType

public class ChoiceType
extends Type

Schema for ASN.1 CHOICE type.

There is n universal class tag assignment for this type.

XML ASN.1 type name is CHOICE.

For more information on this ASN.1 type see Java class ASN1Choice

Version:
1.00 - 2006/02/09
Author:
support@phillipgriffin.com

Field Summary
 
Fields inherited from class schemajic.schema.Type
_tags
 
Constructor Summary
ChoiceType(Module module, java.lang.String name, java.lang.String type, java.lang.String tags)
          Constructor for ChoiceType with ASN.1 module, user defined ASN.1 type, builtin or referenced ASN.1 type, context specific tags and named values parameters.
ChoiceType(java.lang.String name)
          Constructor for ChoiceType with ASN.1 type name parameter.
 
Method Summary
 void accept(TypeVisitor v)
          Calls the visit method of the TypeVisitor, passing itself as an argument.
 void addField(Field f)
          Adds the provided field to the list of fields.
 ASN1Value createFieldInstance(java.lang.String fieldName, EncodingRule rule)
          Creates an instance of an ASN.1 value for the provided type of ASN.1 encoding rules.
 Field getField(int index)
          Gets the field indicated by the provided position in the field list.
 int getFieldIndex(java.lang.String fieldName)
          Gets the index for a provided field.
 java.util.Iterator getFields()
          Gets the current list of fileds.
 
Methods inherited from class schemajic.schema.Type
createInstance, getJavaName, getModule, getName, getPackageName, getTags, getType, getTypeName, getXMLName, isChoice, isNull, isOpenType, isRoot, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChoiceType

public ChoiceType(Module module,
                  java.lang.String name,
                  java.lang.String type,
                  java.lang.String tags)
Constructor for ChoiceType with ASN.1 module, user defined ASN.1 type, builtin or referenced ASN.1 type, context specific tags and named values parameters.

Parameters:
module - the ASN.1 module where a user defined type name is specified
name - the name of a user defined type
type - a builtin or referenced type defined in the ASN.1 standards
tags - the tag class, tag number, and encoding type assigned in the ASN.1 standards to the type

ChoiceType

public ChoiceType(java.lang.String name)
Constructor for ChoiceType with ASN.1 type name parameter.

Parameters:
name -
Method Detail

addField

public void addField(Field f)
Adds the provided field to the list of fields.

Parameters:
f - name of the field to be added to the current list of fields

getFields

public java.util.Iterator getFields()
Gets the current list of fileds.

Returns:
a field list iterator

getField

public Field getField(int index)
Gets the field indicated by the provided position in the field list.

Parameters:
index - position of a field in a list of fields
Returns:
the field indicated by the provided field list position

createFieldInstance

public ASN1Value createFieldInstance(java.lang.String fieldName,
                                     EncodingRule rule)
                              throws java.lang.ClassNotFoundException,
                                     java.lang.InstantiationException,
                                     java.lang.IllegalAccessException
Creates an instance of an ASN.1 value for the provided type of ASN.1 encoding rules.

Parameters:
fieldName - the name of the field to create
Returns:
an instance of the filed or null
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

getFieldIndex

public int getFieldIndex(java.lang.String fieldName)
Gets the index for a provided field.

Parameters:
fieldName - the name of the field
Returns:
the index value of the field or -1

accept

public void accept(TypeVisitor v)
Calls the visit method of the TypeVisitor, passing itself as an argument.

Specified by:
accept in class Type
Parameters:
v - instance of the type visitor

XCMS Toolkit


Copyright © 2005-2006 GRIFFIN Consulting. All Rights Reserved.