|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.informatica.powercenter.sdk.mapfwk.core.Field
public class Field
Represents a column in a Table.
Field
is used to create columns in a source, target
and transformation
Fields can be created in a source, target and transformation by calling
Table.setFields(Vector)
function in Source
,
Target
and Transformation
Following is a code example for using Field
while
creating a flat file source
// create a vector to hold the fields
Vector fields = new Vector();
// create a field of type of integer and add to the vector of fields
Field field1 = new Field("EmployeeID", "EmployeeID","", DataTypeConstants.INTEGER, "10", "0",
FieldConstants.PRIMARY_KEY, Field.FIELDTYPE_SOURCE, true);
fields.add(field1);
// create a field of type of string and add to the vector of fields
Field field2 = new Field("LastName", "LastName","", DataTypeConstants.STRING, "20", "0",
FieldConstants.NOT_A_KEY, Field.FIELDTYPE_SOURCE, false);
fields.add(field2);
// create connection info for a flat file source and set the connection
// properties (not demonstrated in the code)
ConnectionInfo ffConn = new ConnectionInfo( SourceTargetTypes.FLATFILE_TYPE );
// create a Source
Source employeeSource = new Source( "Employee", "Employee", "This is Employee Table",
"Employee", ffConn );
// set the fields in the Source
employeeSource.setFields( fields );
CustomField
,
SourceTarget.setFields(Vector)
,
SourceTarget.setFields(Vector)
,
Table.setFields(Vector)
Field Summary | |
---|---|
static int |
DATATYPE_FLAG_MODIFIED
Constant for DATATYPE_FLAG_MODIFIED |
static int |
DATATYPE_FLAG_NOTPRESERVE
Constant for DATATYPE_FLAG_NOTPRESERVE |
static int |
DATATYPE_FLAG_PRESERVE
Constant for DATATYPE_FLAG_PRESERVE |
static java.lang.String |
EXPRTYPE_GENERAL
General Expression |
static java.lang.String |
EXPRTYPE_GROUPBY
Group By Expression |
static java.lang.String |
EXPRTYPE_JOINER
Joiner Field |
static java.lang.String |
EXPRTYPE_RANKINDEX
RANK INDEX |
static java.lang.String |
EXPRTYPE_RANKPORT
Rank port |
static int |
FIELDTYPE_SOURCE
Source field type |
static int |
FIELDTYPE_TARGET
Target field type |
static int |
FIELDTYPE_TRANSFORM
Expression field type |
static int |
FIELDTYPE_VARIABLE
Variable field type |
static java.lang.String |
ISNOTSORTKEY
To specify Sort Key for Rank |
static java.lang.String |
ISSORTKEY
To specify Sort Key for Rank |
static java.lang.String |
SORT_ASCENDING
Sort direction ascending |
static java.lang.String |
SORT_DESCENDING
Sort direction descending |
Constructor Summary | |
---|---|
Field()
Default constructor |
|
Field(java.lang.String name,
java.lang.String busName,
java.lang.String description,
java.lang.String dataType,
java.lang.String prec,
java.lang.String scale,
int keyType,
int fieldType,
boolean notNull)
Initialize a Field by specifying name, business name, description, data type, precision, scale, key type, field type, whether it can be null |
Method Summary | |
---|---|
java.lang.Object |
clone()
Deep clones the field object |
boolean |
equals(java.lang.Object obj)
Compares the specified object with this Field for equality. |
java.lang.Object |
getAttribute(java.lang.Object key)
Gets the attribute value for a given key |
java.lang.String |
getBusinessName()
Gets the business name |
java.lang.String |
getDataType()
Gets the data type of the field. Returned data type is one of the constants defined in DataTypeConstants |
int |
getDataTypeFlag()
Gets the datatype flag |
java.lang.String |
getDefaultValue()
Gets the default value of the field |
java.lang.String |
getDescription()
Gets the description of the field |
java.lang.String |
getExprType()
Gets expression type |
java.util.Vector |
getExtensionAttrs()
Gets a list of MetaExtension attributes |
java.util.Map |
getFieldAttributes()
Gets the attributes (key, value pair) of the field |
int |
getFieldType()
Gets the field type. |
java.lang.String |
getGroupName()
Gets the group name |
int |
getKeyType()
Gets the key type of the field. |
java.lang.String |
getLevel()
Gets the level of the field. Default is 0 |
java.lang.String |
getName()
Gets the name of the field |
java.lang.String |
getOccurs()
Gets the number of occurance. |
java.lang.String |
getOffset()
Gets the offset. Default value is 0 |
java.lang.String |
getOrigName()
Gets original name of the field |
java.lang.String |
getPhysicalLength()
Gets the physical length. |
java.lang.String |
getPhysicalOffset()
Gets the physical offset. |
java.lang.String |
getPrecision()
Gets the precision of field |
java.lang.String |
getReferencedFieldName()
Gets the referenced field name |
java.lang.String |
getReferencedSourceName()
Gets the referenced source name |
java.lang.String |
getScale()
Gets the scale of the field |
java.lang.String |
getXML()
Gets the XML string |
boolean |
isNotNull()
Finds if field cannot be null |
boolean |
isReadOnly()
Gets the readonly flag |
boolean |
isVariable()
Finds whether field of variable type |
void |
setAttributeValues(java.lang.Object key,
java.lang.Object value)
Sets the attribute of the field |
void |
setBusinessName(java.lang.String businessName)
Sets the business name |
void |
setDataType(java.lang.String dataType)
Sets the data type of the field. |
void |
setDataTypeFlag(int dataTypeFlag)
Sets the datatype flag |
void |
setDefaultValue(java.lang.String defaultValue)
Sets the default value of the field |
void |
setDescription(java.lang.String description)
Sets the description of the field |
void |
setExprType(java.lang.String expr)
Sets the expression type |
void |
setExtensionAttrs(java.util.Vector metaAttrs)
Sets the collection of MetaExtension attributes |
void |
setFieldAttributes(java.util.Map fieldAttributes)
Sets the attributes (key, value pair) of the field |
void |
setFieldType(int fieldType)
Sets the field type. |
void |
setGroupName(java.lang.String groupName)
Sets the group name |
void |
setKeyType(int keyType)
Sets the key type of the field. |
void |
setLevel(java.lang.String level)
Sets the level of the field. Default is 0 |
void |
setName(java.lang.String name)
Sets the field name |
void |
setNotNull(boolean value)
Specifies whether field cannot be null |
void |
setOccurs(java.lang.String occurs)
Set the number of occurences. Default value is 0 |
void |
setOffset(java.lang.String offset)
Sets the offset. Default value is 0 |
void |
setOrigName(java.lang.String origName)
Sets the original name of the field |
void |
setPhysicalLength(java.lang.String physicalLength)
Sets the physical length. |
void |
setPhysicalOffset(java.lang.String physicalOffset)
Sets the physical offset. |
void |
setPrecision(java.lang.String precision)
Sets the precision of field |
void |
setReferenceConstraint(java.lang.String referencedSourceName,
java.lang.String referencedFieldName)
Sets the foreign key relationship with primary key field of other source |
void |
setReferencedFieldName(java.lang.String referencedFieldName)
Sets the referenced field name |
void |
setReferencedSourceName(java.lang.String referencedSourceName)
Sets the referenced source name |
void |
setScale(java.lang.String scale)
Sets the scale of the field |
void |
setVariable(boolean variable)
Sets the field as variable |
void |
setXML(java.lang.String strxml)
Sets the XML String |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FIELDTYPE_SOURCE
public static final int FIELDTYPE_TARGET
public static final int FIELDTYPE_TRANSFORM
public static final int FIELDTYPE_VARIABLE
public static final java.lang.String EXPRTYPE_GENERAL
public static final java.lang.String EXPRTYPE_GROUPBY
public static final java.lang.String EXPRTYPE_RANKPORT
public static final java.lang.String EXPRTYPE_RANKINDEX
public static final java.lang.String ISSORTKEY
public static final java.lang.String ISNOTSORTKEY
public static final java.lang.String SORT_ASCENDING
public static final java.lang.String SORT_DESCENDING
public static final java.lang.String EXPRTYPE_JOINER
public static final int DATATYPE_FLAG_NOTPRESERVE
public static final int DATATYPE_FLAG_PRESERVE
public static final int DATATYPE_FLAG_MODIFIED
Constructor Detail |
---|
public Field()
public Field(java.lang.String name, java.lang.String busName, java.lang.String description, java.lang.String dataType, java.lang.String prec, java.lang.String scale, int keyType, int fieldType, boolean notNull)
Key Type specified whether field is a primary key, foreign key etc.
Field type specifies whether is belongs to Source
or a Target
name
- field namebusName
- business namedescription
- field descriptondataType
- data type. Use data types defined in DataTypeConstants
prec
- precisionscale
- scalekeyType
- key type. Use constants defined in FieldConstants
fieldType
- type of the field. Use constants with prefix
FIELDTYPE_defined in Field
notNull
- whether field can be null or notfor data type definitions
,
for key type definitions
Method Detail |
---|
public boolean isVariable()
public void setVariable(boolean variable)
variable
- value to be set.public java.util.Vector getExtensionAttrs()
MetaExtension
attributes
public void setExtensionAttrs(java.util.Vector metaAttrs)
MetaExtension
attributes
metaAttrs
- collection of MetaExtension
public java.lang.String getBusinessName()
public void setBusinessName(java.lang.String businessName)
businessName
- business namepublic java.lang.String getDataType()
DataTypeConstants
public void setDataType(java.lang.String dataType)
DataTypeConstants
dataType
- data type of the field.public int getKeyType()
FieldConstants
public void setKeyType(int keyType)
FieldConstants
keyType
- key type of the fieldpublic java.lang.String getName()
public void setName(java.lang.String name)
name
- field name.public java.lang.String getPrecision()
public void setPrecision(java.lang.String precision)
precision
- precision of the fieldpublic java.lang.String getScale()
public void setScale(java.lang.String scale)
scale
- scale of the fieldpublic java.lang.String getXML()
public void setXML(java.lang.String strxml)
strxml
- The strXML to set.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- field to be compared for equalitypublic int getFieldType()
Field
public void setFieldType(int fieldType)
Field
fieldType
- field type.public boolean isNotNull()
public void setNotNull(boolean value)
value
- true or falsepublic java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- field descriptiompublic java.lang.String getExprType()
public void setExprType(java.lang.String expr)
expr
- expression typepublic java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getOrigName()
public void setOrigName(java.lang.String origName)
origName
- original name of the field.public java.lang.String getDefaultValue()
public void setDefaultValue(java.lang.String defaultValue)
defaultValue
- default value of the fieldpublic java.lang.String getReferencedFieldName()
public void setReferencedFieldName(java.lang.String referencedFieldName)
referencedFieldName
- sreferenced field namepublic java.lang.String getReferencedSourceName()
public void setReferencedSourceName(java.lang.String referencedSourceName)
referencedSourceName
- referenced source namepublic void setReferenceConstraint(java.lang.String referencedSourceName, java.lang.String referencedFieldName)
referencedSourceName
- source namereferencedFieldName
- field Namepublic java.util.Map getFieldAttributes()
public void setFieldAttributes(java.util.Map fieldAttributes)
fieldAttributes
- map of field attributespublic java.lang.Object getAttribute(java.lang.Object key)
key
- field attribute key
public void setAttributeValues(java.lang.Object key, java.lang.Object value)
key
- field attribute keyvalue
- field attribute valuepublic int getDataTypeFlag()
public void setDataTypeFlag(int dataTypeFlag)
dataTypeFlag
- datatype flagpublic boolean isReadOnly()
public java.lang.String getLevel()
public void setLevel(java.lang.String level)
level
- field levelpublic java.lang.String getOccurs()
public void setOccurs(java.lang.String occurs)
occurs
- number of occurancespublic java.lang.String getOffset()
public void setOffset(java.lang.String offset)
offset
- offsetpublic java.lang.String getPhysicalLength()
public void setPhysicalLength(java.lang.String physicalLength)
physicalLength
- physical lengthpublic java.lang.String getPhysicalOffset()
public void setPhysicalOffset(java.lang.String physicalOffset)
physicalOffset
- physical offsetpublic java.lang.String getGroupName()
public void setGroupName(java.lang.String groupName)
group
- name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |