net.sf.cb2java.copybook
Class AlphaNumeric

java.lang.Object
  extended bynet.sf.cb2java.copybook.Element
      extended bynet.sf.cb2java.copybook.Leaf
          extended bynet.sf.cb2java.copybook.AlphaNumeric

public class AlphaNumeric
extends net.sf.cb2java.copybook.Leaf

Class used to represent alpha and alphanumeric data types

Author:
James Watson

Constructor Summary
AlphaNumeric(java.lang.String name, int level, int occurs, java.lang.String pattern)
           
 
Method Summary
 java.util.List getChildren()
          gets the children of this element or null if there are none
protected  int getLength()
          returns the length of one instance of this element
 java.util.regex.Pattern getPattern()
           
protected  Value getValue()
          the value for this element
 byte[] toBytes(java.lang.Object data)
          converts the supplied data to bytes
 void validate(java.lang.Object data)
          validates the data based on this element definition
 
Methods inherited from class net.sf.cb2java.copybook.Element
getBytes, getLevel, getName, getOccurs, getPosition, getString, toString, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlphaNumeric

public AlphaNumeric(java.lang.String name,
                    int level,
                    int occurs,
                    java.lang.String pattern)
Method Detail

getLength

protected int getLength()
Description copied from class: Element
returns the length of one instance of this element

Specified by:
getLength in class Element
Returns:
the length of one instance of this element

getPattern

public java.util.regex.Pattern getPattern()

validate

public void validate(java.lang.Object data)
Description copied from class: Element
validates the data based on this element definition

Specified by:
validate in class Element
Parameters:
data - the data to validate

toBytes

public byte[] toBytes(java.lang.Object data)
Description copied from class: Element
converts the supplied data to bytes

Specified by:
toBytes in class Element
Parameters:
data - the data to convert to bytes
Returns:
the bytes for the data

getValue

protected Value getValue()
Description copied from class: Element
the value for this element

Specified by:
getValue in class Element
Returns:
the value set for this element or the default

getChildren

public java.util.List getChildren()
Description copied from class: Element
gets the children of this element or null if there are none

Specified by:
getChildren in class Element
Returns:
the children of this element or null if there are none