net.sf.cb2java.copybook.data
Class GroupData

java.lang.Object
  extended bynet.sf.cb2java.copybook.data.Data
      extended bynet.sf.cb2java.copybook.data.GroupData
Direct Known Subclasses:
Record

public class GroupData
extends Data


Constructor Summary
GroupData(Group definition, java.util.List children)
           
 
Method Summary
 Data getChild(java.lang.String name)
          returns the first child with the specified name irrespective of case
 java.util.List getChildren()
          returns a immutable collection of children
 java.lang.Object getValue()
          returns the children of this item
 boolean isLeaf()
          Returns whether this element is a leaf element.
protected  void setValueImpl(java.lang.Object data)
          not supported
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String indent)
          gives a string representation of this element with the given indention
protected  java.lang.Object translate(java.lang.String data)
          Converts the String to the underlying Data type's 'natural' type.
 void write(java.io.OutputStream stream)
          writes this Data instance to the stream as COBOL application data.
 
Methods inherited from class net.sf.cb2java.copybook.data.Data
getDefinition, getName, setValue, setValue, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupData

public GroupData(Group definition,
                 java.util.List children)
Method Detail

isLeaf

public boolean isLeaf()
Description copied from class: Data
Returns whether this element is a leaf element. i.e. returns true if it is not a group.

Specified by:
isLeaf in class Data
Returns:
whether this element is a leaf element

getChildren

public java.util.List getChildren()
returns a immutable collection of children

Specified by:
getChildren in class Data

getChild

public Data getChild(java.lang.String name)
returns the first child with the specified name irrespective of case

Parameters:
name - the name of the child to look for
Returns:
the first child with the given name
Throws:
java.lang.IllegalArgumentException - if no child is found

toString

public java.lang.String toString()

toString

public java.lang.String toString(java.lang.String indent)
Description copied from class: Data
gives a string representation of this element with the given indention

Specified by:
toString in class Data
Parameters:
indent - the string used to indent

write

public void write(java.io.OutputStream stream)
           throws java.io.IOException
Description copied from class: Data
writes this Data instance to the stream as COBOL application data.

Overrides:
write in class Data
Parameters:
stream - the stream to write to
Throws:
java.io.IOException

getValue

public java.lang.Object getValue()
returns the children of this item

Specified by:
getValue in class Data

translate

protected java.lang.Object translate(java.lang.String data)
Description copied from class: Data
Converts the String to the underlying Data type's 'natural' type. The String must be understood by the data type.

Specified by:
translate in class Data
Parameters:
data - the string to use to set this data's value
Returns:
an instance of the Data type's 'natural' type

setValueImpl

protected void setValueImpl(java.lang.Object data)
not supported

Specified by:
setValueImpl in class Data
Parameters:
data - the data to set