All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.tools.dataFormatWizard.SchemaRecord
java.lang.Object
|
+----com.ibm.beans.tools.dataFormatWizard.SchemaItem
|
+----com.ibm.beans.tools.dataFormatWizard.SchemaRecord
- public class SchemaRecord
- extends SchemaItem
- implements DiscardAttribute, NameAttribute, BlocksizeAttribute, OptionAttribute, RepeatAttribute
The SchemaRecord class represents a record expected at a given
point within a file schema. It contains a list of child
SchemaItem records, fields, and assertions.
- See Also:
- SchemaItem, DiscardAttribute, NameAttribute, BlocksizeAttribute, OptionAttribute, RepeatAttribute
-
ITEMS_PROPERTY
- Indicates that the list of items for this schema record has changed.
-
SchemaRecord()
- Creates a SchemaRecord instance.
-
addItemAfter(SchemaItem, SchemaItem)
- Adds a schema item to this record immediately after the
specified item.
-
addItemBefore(SchemaItem, SchemaItem)
- Adds a schema item to this record immediately before the
specified item.
-
addItemFirst(SchemaItem)
- Adds a schema item to the beginning of this record.
-
addItemLast(SchemaItem)
- Adds a schema item to the end of this record.
-
emitAsClass()
- Emits source code to declare a new class file for the record data
represented by this schema item.
-
emitDeclaration(PrintWriter)
- Emits source code to declare storage for the field or record data
represented by this schema item.
-
emitGetterMethod(PrintWriter)
- Emits source code to get the field or record data represented
by this schema item.
-
emitReadLegacyCode(PrintWriter, String)
- Emits source code to read the field or record data represented
by this schema item.
-
getAttributesAsText()
- Gets a string representing the attributes of this record.
-
getBlocksize()
- Gets the block size (in bytes) for this schema item.
-
getItems()
- Gets the items for this schema record.
-
getName()
- Returns the name of this schema item.
-
getOptionTest()
- Gets the option test for this schema item.
-
getRepeatTest()
- Gets the repeat test for this schema item.
-
getRepeatType()
- Gets the repeat type for this schema item.
-
getView()
- Gets a graphical user interface component for displaying this
schema item.
-
getViewColor()
- Gets the view color for this schema record.
-
getViewTitleComponent()
- Gets the title component for the view of this schema record.
-
hasAttribute(Class)
- Reports whether this schema item supports a given attribute interface.
-
insertNewItem(SchemaItem)
- Inserts a new item into the schema.
-
isDiscardable()
- Reports whether this schema item is discardable.
-
isSchemaRecord(Object)
- Checks whether a given object is a schema record.
-
isViewComponentExpanded()
- Reports whether the view panel for this schema record is expanded.
-
removeItem(SchemaItem)
- Removes a schema item from this record.
-
setBlocksize(int)
- Sets the block size (in bytes) for this schema item.
-
setDiscardable(boolean)
- Controls whether this schema item is discardable.
-
setName(String)
- Sets the new name of this schema item.
-
setOptionTest(String)
- Sets the option test for this schema item.
-
setRepeatTest(String)
- Sets the repeat test for this schema item.
-
setRepeatType(byte)
- Sets the repeat type for this schema item.
-
setViewColor(Color)
- Sets the view color for this schema record.
ITEMS_PROPERTY
public static final String ITEMS_PROPERTY
- Indicates that the list of items for this schema record has changed.
SchemaRecord
public SchemaRecord()
- Creates a SchemaRecord instance.
insertNewItem
public void insertNewItem(SchemaItem newItem)
- Inserts a new item into the schema.
If the view for this record is not expanded, and the parent
item of this record is not null, inserts the new item
into the parent instead of this record.
Otherwise, inserts the new item into this record as follows:
If the new item is a file schema, inserts all of its records
as sub-items at the end of this record.
If the new item is a schema record, inserts it as a sub-item
at the end of this record.
If the new item is a schema field, inserts it as a sub-item
at the end of this record.
- Parameters:
- newItem - The new item to be added to this record.
- Overrides:
- insertNewItem in class SchemaItem
removeItem
public void removeItem(SchemaItem removeItem)
- Removes a schema item from this record.
- Parameters:
- removeItem - The schema item to be removed.
- Overrides:
- removeItem in class SchemaItem
emitDeclaration
public void emitDeclaration(PrintWriter sourceCodeStream)
- Emits source code to declare storage for the field or record data
represented by this schema item.
- Parameters:
- sourceCodeStream - The source code output stream.
- Overrides:
- emitDeclaration in class SchemaItem
emitGetterMethod
public void emitGetterMethod(PrintWriter sourceCodeStream)
- Emits source code to get the field or record data represented
by this schema item.
- Parameters:
- sourceCodeStream - The source code output stream.
- Overrides:
- emitGetterMethod in class SchemaItem
emitReadLegacyCode
public void emitReadLegacyCode(PrintWriter sourceCodeStream,
String inputStreamName)
- Emits source code to read the field or record data represented
by this schema item.
- Parameters:
- sourceCodeStream -
- The source code output
stream.
- inputStreamName -
- The input stream name
to be used by the emitted
code.
- Overrides:
- emitReadLegacyCode in class SchemaItem
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
getAttributesAsText
public String getAttributesAsText()
- Gets a string representing the attributes of this record.
- Returns:
- A string representing the attributes of this record.
- Overrides:
- getAttributesAsText in class SchemaItem
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
emitAsClass
public boolean emitAsClass()
- Emits source code to declare a new class file for the record data
represented by this schema item.
- Returns:
- true if a reader class was sucessfully
emitted; false otherwise.
getItems
public SchemaItem[] getItems()
- Gets the items for this schema record.
- Returns:
- An array of schema items for this schema record.
getViewColor
public Color getViewColor()
- Gets the view color for this schema record.
- Returns:
- The view color for this schema record.
isSchemaRecord
public static boolean isSchemaRecord(Object candidate)
- Checks whether a given object is a schema record.
- Parameters:
- candidate - The object to be tested.
- Returns:
- true if the object is a schema record;
false otherwise.
addItemFirst
public void addItemFirst(SchemaItem newItem)
- Adds a schema item to the beginning of this record.
- Parameters:
- newItem - The schema item to add.
addItemLast
public void addItemLast(SchemaItem newItem)
- Adds a schema item to the end of this record.
- Parameters:
- newItem - The schema item to add.
addItemBefore
public void addItemBefore(SchemaItem newItem,
SchemaItem beforeItem)
- Adds a schema item to this record immediately before the
specified item.
- Parameters:
- newItem - The schema item to add.
- beforeItem - Add the new item before this item.
addItemAfter
public void addItemAfter(SchemaItem newItem,
SchemaItem afterItem)
- Adds a schema item to this record immediately after the
specified item.
- Parameters:
- newItem - The schema item to add.
- afterItem - Add the new item after this item.
setViewColor
public void setViewColor(Color newColor)
- Sets the view color for this schema record.
- Parameters:
- newColor - The new view color for this schema record.
getViewTitleComponent
public Component getViewTitleComponent()
- Gets the title component for the view of this schema record.
- Returns:
- The title component.
isViewComponentExpanded
public boolean isViewComponentExpanded()
- Reports whether the view panel for this schema record is expanded.
- Returns:
- true if the view panel is expanded;
false otherwise.
isDiscardable
public boolean isDiscardable()
- Reports whether this schema item is discardable.
- Returns:
- true if this schema item is discardable;
false otherwise.
setDiscardable
public void setDiscardable(boolean newState)
- Controls whether this schema item is discardable.
- Parameters:
- newState - true to make this schema item
discardable; false otherwise.
getBlocksize
public int getBlocksize()
- Gets the block size (in bytes) for this schema item.
- Returns:
- The block size (in bytes) for this schema item.
setBlocksize
public void setBlocksize(int newBlocksize)
- Sets the block size (in bytes) for this schema item.
- Parameters:
- newBlocksize - The new block size for this schema item.
getName
public String getName()
- Returns the name of this schema item.
- Returns:
- The name of this schema item.
setName
public void setName(String newName)
- Sets the new name of this schema item.
- Parameters:
- newName - The new name for this schema item.
getOptionTest
public String getOptionTest()
- Gets the option test for this schema item.
If the option test is null (the default), this schema
item is always expected to appear in the data stream. If the option
test is not null, it specifies when the item is expected.
The option test must be a valid Java boolean expression. It may
use constants or values of other schema items.
- Returns:
- The option test for this schema item.
setOptionTest
public void setOptionTest(String newTest)
- Sets the option test for this schema item.
- Parameters:
- newTest - The new option test for this schema item.
getRepeatTest
public String getRepeatTest()
- Gets the repeat test for this schema item. The repeat test
specifies conditions for reading a schema item more than once,
when certain values are set for the repeat type.
If the repeat type value is REPEAT_N_TIMES, the repeat test
must be a valid Java numeric expression. It may use constants,
or numeric values of other schema items.
If the repeat type value is REPEAT_WHILE_X or REPEAT_UNTIL_X,
the repeat test must be a valid Java boolean expression. It may
use constants, or boolean values of other schema items.
If the repeat type value is any other value, the repeat test
is ignored.
- Returns:
- The repeat test for this schema item.
- See Also:
- RepeatAttribute
getRepeatType
public byte getRepeatType()
- Gets the repeat type for this schema item. The repeat type
controls the number of times that a schema item is read
from the input stream.
- Returns:
- The repeat type for this schema item.
- See Also:
- RepeatAttribute
setRepeatTest
public void setRepeatTest(String newTest)
- Sets the repeat test for this schema item.
- Parameters:
- newTest - The new repeat test for this schema item.
- See Also:
- RepeatAttribute
setRepeatType
public void setRepeatType(byte newType)
- Sets the repeat type for this schema item.
- Parameters:
- newType - The new repeat type for this schema item.
- Throws: IllegalArgumentException
- Thrown if the new repeat type is not one
of the legal values for a repeat type, as
defined in interface RepeatAttribute. A
schema record cannot be assigned repeat
type REPEAT_UNTIL_EOB.
- See Also:
- RepeatAttribute
All Packages Class Hierarchy This Package Previous Next Index