CICS® Transaction Gateway Programming Reference v1.1.0.0

com.ibm.ctg.epi
Class Field

java.lang.Object
  extended by com.ibm.ctg.epi.Field
All Implemented Interfaces:
java.io.Serializable

public class Field
extends java.lang.Object
implements java.io.Serializable

This class represents a field in a 3270 screen and provides methods to query and set the contents and attributes of the field.

The field can be thought of as a piece of text with various attributes that define the way it is displayed on a 3270 terminal. A 3270 terminal would display the base attribute as a space, followed by the field text.

The base attribute byte is a bit field that encodes the field attributes. see the 3270 Datastream Programmers Reference for details.

See Also:
Serialized Form

Field Summary
static int alphanumeric
          Alphanumeric field.
static int black
          The color black.
static int blinkHlt
          Blink highlight.
static int blue
          The color blue.
static int cyan
          The color cyan.
static int dark
          Dark.
static int darkblue
          The color dark blue.
static int defaultColor
          Default colour.
static int defaultHlt
          Default highlight.
static int defaultTran
          Default transparency.
static int gray
          The color gray.
static int green
          The color green.
static int intense
          Intense.
static int intenseHlt
          Intense highlight.
static int isprotect
          Protected field which does not allow data entry.
static int modified
          Modified field (will be flowed back to the server).
static int neutral
          Neutral foreground color.
static int neutralBGrnd
          Neutral background colour.
static int normal
          Normal intensity.
static int normalHlt
          Normal highlight.
static int numeric
          Numeric field (non-numeric characters cannot be entered).
static int opaqueTran
          Opaque transparency.
static int orange
          The color orange.
static int orTran
          OR transparency.
static int paleCyan
          The color pale cyan.
static int paleGreen
          The color pale green.
static int pink
          The color pink.
static int purple
          The color purple.
static int red
          The color red.
static int reverseHlt
          Reverse highlight.
static int underscoreHlt
          Underscore highlight.
static int unmodified
          Unmodified field (does not need to be flowed back to the server).
static int unprotect
          Unprotected field allowing text to be modified.
static int white
          The color white.
static int xorTran
          XOR transparency.
static int yellow
          The color yellow.
 
Method Summary
 void appendText(java.lang.String append)
          Appends the given String to the field text.
 int backgroundColor()
          Returns a constant indicating the background color of the field.
 char baseAttribute()
          Returns the 3270 base attribute of the field.
 int dataTag()
          Returns a constant indicating whether or not the data in the field has been modified.
 int foregroundColor()
          Returns a constant indicating the foreground color of the field.
 byte[] getBytes()
          Returns the text currently in the field as a byte array.
 int getColumn()
          Returns the column at which the field starts on the screen.
 int getPosition()
          Returns the position of the start of the field on the screen.
 int getRow()
          Returns the row at which the field starts on the screen.
 java.lang.String getText()
          Returns the contents of the field as a String.
 boolean hasAttribute()
          Returns a boolean indicating the presence of a field attribute.
 int highlight()
          Returns a constant indicating which type of highlight is being used.
 int inputProt()
          Returns a constant indicating whether or not the field is protected.
 int inputType()
          Returns a constant indicating the input data type for this field.
 int intensity()
          Returns a constant indicating the field intensity.
 int length()
          Returns the total length of the field.
 void resetDataTag()
          Resets the Modified Data Tag (MDT) to unmodified.
 void setBaseAttribute(char attr)
          Sets the 3270 base attribute.
 void setBytes(int pos, byte[] newbytes, int length)
          Deprecated. This Method is not recommended for use as extreme care is required To ensure that the bytes are in the correct encoding and the buffer address and length are exactly correct. You should use setText instead to ensure correct field manipulation.
 void setExtAttribute(char type, char value)
          Sets an extended 3270 attribute.
 void setText(java.lang.String newtext)
          Set the contents of the field to the given String.
 int textLength()
          Returns the number of characters in the field.
 int transparency()
          Returns a constant indicating the background transparency of the field.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultHlt

public static final int defaultHlt
Default highlight.

See Also:
Constant Field Values

normalHlt

public static final int normalHlt
Normal highlight.

See Also:
Constant Field Values

blinkHlt

public static final int blinkHlt
Blink highlight.

See Also:
Constant Field Values

reverseHlt

public static final int reverseHlt
Reverse highlight.

See Also:
Constant Field Values

underscoreHlt

public static final int underscoreHlt
Underscore highlight.

See Also:
Constant Field Values

intenseHlt

public static final int intenseHlt
Intense highlight.

See Also:
Constant Field Values

defaultColor

public static final int defaultColor
Default colour.

See Also:
Constant Field Values

neutralBGrnd

public static final int neutralBGrnd
Neutral background colour.

See Also:
Constant Field Values

blue

public static final int blue
The color blue.

See Also:
Constant Field Values

red

public static final int red
The color red.

See Also:
Constant Field Values

pink

public static final int pink
The color pink.

See Also:
Constant Field Values

green

public static final int green
The color green.

See Also:
Constant Field Values

cyan

public static final int cyan
The color cyan.

See Also:
Constant Field Values

yellow

public static final int yellow
The color yellow.

See Also:
Constant Field Values

neutral

public static final int neutral
Neutral foreground color.

See Also:
Constant Field Values

black

public static final int black
The color black.

See Also:
Constant Field Values

darkblue

public static final int darkblue
The color dark blue.

See Also:
Constant Field Values

orange

public static final int orange
The color orange.

See Also:
Constant Field Values

purple

public static final int purple
The color purple.

See Also:
Constant Field Values

paleGreen

public static final int paleGreen
The color pale green.

See Also:
Constant Field Values

paleCyan

public static final int paleCyan
The color pale cyan.

See Also:
Constant Field Values

gray

public static final int gray
The color gray.

See Also:
Constant Field Values

white

public static final int white
The color white.

See Also:
Constant Field Values

defaultTran

public static final int defaultTran
Default transparency.

See Also:
Constant Field Values

orTran

public static final int orTran
OR transparency.

See Also:
Constant Field Values

xorTran

public static final int xorTran
XOR transparency.

See Also:
Constant Field Values

opaqueTran

public static final int opaqueTran
Opaque transparency.

See Also:
Constant Field Values

isprotect

public static final int isprotect
Protected field which does not allow data entry.

See Also:
Constant Field Values

unprotect

public static final int unprotect
Unprotected field allowing text to be modified.

See Also:
Constant Field Values

alphanumeric

public static final int alphanumeric
Alphanumeric field.

See Also:
Constant Field Values

numeric

public static final int numeric
Numeric field (non-numeric characters cannot be entered). This is not currently enforced.

See Also:
Constant Field Values

normal

public static final int normal
Normal intensity.

See Also:
Constant Field Values

intense

public static final int intense
Intense.

See Also:
Constant Field Values

dark

public static final int dark
Dark.

See Also:
Constant Field Values

unmodified

public static final int unmodified
Unmodified field (does not need to be flowed back to the server).

See Also:
Constant Field Values

modified

public static final int modified
Modified field (will be flowed back to the server).

See Also:
Constant Field Values
Method Detail

hasAttribute

public boolean hasAttribute()
Returns a boolean indicating the presence of a field attribute.

Returns:
true if an attribute is present

getPosition

public int getPosition()
Returns the position of the start of the field on the screen.

Returns:
the position

getRow

public int getRow()
Returns the row at which the field starts on the screen.

Returns:
the row number

getColumn

public int getColumn()
Returns the column at which the field starts on the screen.

Returns:
the column number

length

public int length()
Returns the total length of the field.

Returns:
the length

baseAttribute

public char baseAttribute()
Returns the 3270 base attribute of the field.

Returns:
the attribute as a character

inputProt

public int inputProt()
Returns a constant indicating whether or not the field is protected.

Returns:
isprotect or unprotect

inputType

public int inputType()
Returns a constant indicating the input data type for this field.

Returns:
numeric or alphanumeric

intensity

public int intensity()
Returns a constant indicating the field intensity.

Returns:
intense, dark or normal

dataTag

public int dataTag()
Returns a constant indicating whether or not the data in the field has been modified.

Returns:
modified or unmodified

highlight

public int highlight()
Returns a constant indicating which type of highlight is being used.

Returns:
the highlight

transparency

public int transparency()
Returns a constant indicating the background transparency of the field.

Returns:
the transparency

foregroundColor

public int foregroundColor()
Returns a constant indicating the foreground color of the field.

Returns:
the colour

backgroundColor

public int backgroundColor()
Returns a constant indicating the background color of the field.

Returns:
the colour

setBaseAttribute

public void setBaseAttribute(char attr)
Sets the 3270 base attribute.

Parameters:
attr - the attribute

resetDataTag

public void resetDataTag()
Resets the Modified Data Tag (MDT) to unmodified.


setExtAttribute

public void setExtAttribute(char type,
                            char value)
                     throws EPIException
Sets an extended 3270 attribute.

Parameters:
type - the attribute type
value - the attribute value
Throws:
EPIException - if input parameters are invalid

appendText

public void appendText(java.lang.String append)
                throws java.io.UnsupportedEncodingException
Appends the given String to the field text.

Parameters:
append - the text to add
Throws:
UnsupportedEncodingException - if the field text cannot be converted to characters

setBytes

@Deprecated
public void setBytes(int pos,
                                byte[] newbytes,
                                int length)
              throws java.io.UnsupportedEncodingException
Deprecated. This Method is not recommended for use as extreme care is required To ensure that the bytes are in the correct encoding and the buffer address and length are exactly correct. You should use setText instead to ensure correct field manipulation.

Sets the byte array to the specified values starting at the specified buffer address.

Parameters:
pos - the buffer address
newbytes - the bytes
length - the number of bytes
Throws:
UnsupportedEncodingException - if the field text cannot be converted to bytes
java.io.UnsupportedEncodingException

textLength

public int textLength()
Returns the number of characters in the field.

Returns:
the text length

setText

public void setText(java.lang.String newtext)
Set the contents of the field to the given String.

Parameters:
newtext - a String

getText

public java.lang.String getText()
                         throws java.io.UnsupportedEncodingException
Returns the contents of the field as a String.

Returns:
the field text
Throws:
UnsupportedEncodingException - if the field text cannot be converted to characters

getBytes

public byte[] getBytes()
                throws java.io.UnsupportedEncodingException
Returns the text currently in the field as a byte array.

Returns:
the text
Throws:
UnsupportedEncodingException - if the field text cannot be converted to bytes

©Copyright IBM Corp. 1994, 2014
Legal