All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.tools.dataFormatWizard.FileSchema

java.lang.Object
   |
   +----com.ibm.beans.tools.dataFormatWizard.SchemaItem
           |
           +----com.ibm.beans.tools.dataFormatWizard.FileSchema

public class FileSchema
extends SchemaItem
implements NameAttribute
The FileSchema class represents a schema for a given data stream format. It has a schema name and contains a list of child SchemaRecord objects.

See Also:
SchemaRecord

Variable Index

 o SCHEMA_RECORDS_PROPERTY
Indicates that the list of records for this file schema has changed.

Constructor Index

 o FileSchema()
Creates a FileSchema instance.

Method Index

 o addRecordAfter(SchemaRecord, SchemaRecord)
Adds a SchemaRecord object to this collection immediately after the specified record.
 o addRecordBefore(SchemaRecord, SchemaRecord)
Adds a SchemaRecord object to this collection immediately before the specified record.
 o addRecordFirst(SchemaRecord)
Adds a SchemaRecord object to the beginning of this schema.
 o addRecordLast(SchemaRecord)
Adds a SchemaRecord object to the end of this schema.
 o emitAsClass()
Emits source code to declare a new class file for the data represented by this file schema.
 o emitDeclaration(PrintWriter)
Emits source code to declare storage for the field or record data represented by this schema item.
 o emitGetterMethod(PrintWriter)
Emits source code to get the field or record data represented by this schema item.
 o emitReadLegacyCode(PrintWriter, String)
Emits source code to read the field or record data represented by this schema item.
 o getAttributesAsText()
Gets a String representing the attributes of this file schema.
 o getName()
Returns the name of this file schema.
 o getParentItem()
Gets the parent item for this schema item.
 o getRecords()
Gets the records for this file schema.
 o getView()
Gets a graphical user interface component for displaying this schema item.
 o getViewTitleComponent()
Gets the view title component for this schema.
 o hasAttribute(Class)
Reports whether this schema item supports a given attribute interface.
 o insertNewItem(SchemaItem)
Inserts a new item into the schema.

If the new item is of class FileSchema, all of its records will be added to the end of this schema.

If the new item is of class SchemaRecord, it will be added to the end of this schema.

If the new item is of class SchemaField, it will be added to a new empty record, and the new record will be added to the end of this schema.

 o isFileSchema(Object)
Checks whether a given object is a FileSchema object.
 o removeItem(SchemaItem)
Removes a SchemaItem object from this schema.
 o removeRecord(SchemaRecord)
Removes a SchemaRecord object from this schema.
 o setName(String)
Sets the new name of this file schema.
 o setParentItem(SchemaItem)
Sets the new parent item for this schema item.

Variables

 o SCHEMA_RECORDS_PROPERTY
 public static final String SCHEMA_RECORDS_PROPERTY
Indicates that the list of records for this file schema has changed.

Constructors

 o FileSchema
 public FileSchema()
Creates a FileSchema instance.

Methods

 o emitAsClass
 public boolean emitAsClass()
Emits source code to declare a new class file for the data represented by this file schema.

Returns:
true if the reader class was successfully emitted; false otherwise.
 o getRecords
 public SchemaRecord[] getRecords()
Gets the records for this file schema.

Returns:
An array of SchemaRecord objects for this file schema.
 o isFileSchema
 public static boolean isFileSchema(Object candidate)
Checks whether a given object is a FileSchema object.

Parameters:
candidate - The object to be tested.
Returns:
true if candidate object is a FileSchema object; false otherwise.
 o addRecordFirst
 public void addRecordFirst(SchemaRecord record)
Adds a SchemaRecord object to the beginning of this schema.

Parameters:
record - The SchemaRecord object to add.
 o addRecordLast
 public void addRecordLast(SchemaRecord record)
Adds a SchemaRecord object to the end of this schema.

Parameters:
record - The SchemaRecord object to add.
 o addRecordBefore
 public void addRecordBefore(SchemaRecord record,
                             SchemaRecord beforeRecord)
Adds a SchemaRecord object to this collection immediately before the specified record.

Parameters:
record - The SchemaRecord object to add.
beforeRecord - An existing record. The new record should be added immediately before this record.
 o addRecordAfter
 public void addRecordAfter(SchemaRecord record,
                            SchemaRecord afterRecord)
Adds a SchemaRecord object to this collection immediately after the specified record.

Parameters:
record - The SchemaRecord object to add.
afterRecord - An existing record. The new record should be added immediately after this record.
 o removeRecord
 public void removeRecord(SchemaRecord removeRecord)
Removes a SchemaRecord object from this schema.

Parameters:
removeRecord - The SchemaRecord object to be removed.
 o getViewTitleComponent
 public Component getViewTitleComponent()
Gets the view title component for this schema.

Returns:
The view title component for this schema.
 o getParentItem
 public SchemaItem getParentItem()
Gets the parent item for this schema item.

Returns:
The parent item for this schema item.
Overrides:
getParentItem in class SchemaItem
 o setParentItem
 public void setParentItem(SchemaItem newParent)
Sets the new parent item for this schema item.

Parameters:
newParent - The new parent item for this schema item.
Overrides:
setParentItem in class SchemaItem
 o insertNewItem
 public void insertNewItem(SchemaItem newItem)
Inserts a new item into the schema.

If the new item is of class FileSchema, all of its records will be added to the end of this schema.

If the new item is of class SchemaRecord, it will be added to the end of this schema.

If the new item is of class SchemaField, it will be added to a new empty record, and the new record will be added to the end of this schema.

Parameters:
newItem - The new item to be added to the schema.
Overrides:
insertNewItem in class SchemaItem
 o removeItem
 public void removeItem(SchemaItem removeItem)
Removes a SchemaItem object from this schema.

Parameters:
removeItem - The SchemaItem object to be removed.
Overrides:
removeItem in class SchemaItem
 o emitDeclaration
 public void emitDeclaration(PrintWriter sourceCodeStream)
Emits source code to declare storage for the field or record data represented by this schema item. File schema items do not require a field declaration within a container object, since they do not have a container object.

Parameters:
sourceCodeStream - The source code output stream.
Overrides:
emitDeclaration in class SchemaItem
 o emitGetterMethod
 public void emitGetterMethod(PrintWriter sourceCodeStream)
Emits source code to get the field or record data represented by this schema item. File schema items do not need to emit a getter method within a container object, since they do not have a container object.

Parameters:
sourceCodeStream - The source code output stream.
Overrides:
emitGetterMethod in class SchemaItem
 o emitReadLegacyCode
 public void emitReadLegacyCode(PrintWriter sourceCodeStream,
                                String inputStreamName)
Emits source code to read the field or record data represented by this schema item. File schema items do not need to emit source code within the readLegacy method of a container object, since they do not have a container object.

Parameters:
sourceCodeStream -
The source code output stream.
inputStreamName -
The input stream name to be used by the emitted code.
Overrides:
emitReadLegacyCode in class SchemaItem
 o getView
 public ViewForItem getView()
Gets a graphical user interface component for displaying this schema item.

Returns:
A view component for displaying this schema item.
Overrides:
getView in class SchemaItem
 o getAttributesAsText
 public String getAttributesAsText()
Gets a String representing the attributes of this file schema.

Returns:
A String representing the attributes of this file schema.
Overrides:
getAttributesAsText in class SchemaItem
 o hasAttribute
 public boolean hasAttribute(Class attributeClass)
Reports whether this schema item supports a given attribute interface.

Returns:
true if the schema item supports the attribute interface; false otherwise.
Overrides:
hasAttribute in class SchemaItem
 o getName
 public String getName()
Returns the name of this file schema.

Returns:
The name of this file schema.
 o setName
 public void setName(String newName)
Sets the new name of this file schema.

Parameters:
newName - The new name for this file schema.

All Packages  Class Hierarchy  This Package  Previous  Next  Index