|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.instantbank.component.lettertemplate.util.LetterComponent
In memory representation of a letter component.
Field Summary | |
static int |
BODY
Identifies the "body type" of the component. |
static int |
CLOSING
Identifies the "closing type" of the component. |
private long |
code
Unique code in the data base. |
boolean |
hasChanged
Indicates if this component is up to date with respect to the database. |
static int |
HEADER
Identifies the "header type" of the component. |
static java.lang.String |
IMGTYPE
Identifies the image attribute for a character. |
private java.lang.String |
name
Component description. |
private int |
printType
Component print type: LASER, TYPEWRITTER |
private java.lang.String |
rtfText
The text contained in the template in RTF format. |
private java.lang.String |
stamp
Time stamp of the last time the component was saved. |
private java.util.ArrayList |
traceImages
ArrayList containing < position,image> pairs. |
private java.util.ArrayList |
traceVariables
ArrayList containing < position,fieldId, formatCode, offset> tuple. |
private int |
type
Component type : HEADER, BODY, CLOSING |
static java.lang.String |
VARTYPE
Identifies the variable attribute for a character. |
Constructor Summary | |
LetterComponent(int type,
int printType)
Simple constructor from type and printType . |
|
LetterComponent(long code,
int type,
int printType,
java.lang.String name,
java.lang.String rtfText,
java.util.ArrayList traceVariables,
java.util.ArrayList traceImages,
java.lang.String stamp)
Big constructor. |
Method Summary | |
java.lang.String |
codesToString()
Produces a human readable/printable version of the code, name and stamp attributes of this LetterComponent. |
java.lang.String |
extractRtf()
Fixes the rtf text of this component. |
java.util.ArrayList[] |
getAllImages()
Delivers an array with images' information, in ascending order by position: |
java.util.ArrayList[] |
getAllVariables()
Delivers an array with variables' information, in ascending order by position. |
long |
getCode()
Getter method for code |
java.lang.String |
getName()
Getter method for name |
int |
getPrintType()
Getter method for printType |
java.lang.String |
getRtfText()
Getter method for rtfText |
java.lang.String |
getStamp()
Getter method for stamp |
java.util.ArrayList |
getTraceImages()
Getter method for traceImages |
java.util.ArrayList |
getTraceVariables()
Getter method for traceVariables |
int |
getType()
Getter method for type |
boolean |
hasVariables()
Answers whether or not this component has variables. |
java.lang.String |
mergeToString(java.util.ArrayList[] merge)
Delivers a String representation of a merge structure for variables and images. |
java.util.ArrayList[] |
mergeVarsImages()
Calculates the "merge" of this component's variables and images, in descending order by their position in the text. |
void |
setCode(long code)
Setter method for code |
void |
setName(java.lang.String name)
Setter method for name |
java.util.ArrayList[] |
setOfVariables()
Calculates the set --without repetitions-- of codes of variables mentioned in this components. |
void |
setPrintType(int printType)
Setter method for printType |
void |
setRtfText(java.lang.String rtfText)
Setter method for rtfText |
void |
setStamp(java.lang.String st)
Setter method for stamp |
void |
setTraceImages(java.util.ArrayList traceImages)
Setter method for traceImages |
void |
setTraceVariables(java.util.ArrayList traceVariables)
Setter method for traceVariables |
void |
setType(int type)
Setter method for type |
java.lang.String |
toFoTemplate()
Transform this LetterComponent in a "fo-template" without external references to image files. |
java.lang.String |
traceImgToString()
traceImgToStringod |
java.lang.String |
traceImgToString(java.util.ArrayList trace)
traceImgToString |
java.lang.String |
traceVarsToString()
traceVarsToString |
java.lang.String |
traceVarsToString(java.util.ArrayList trace)
traceVarsToString |
static java.lang.String |
typeToPlural(int type)
Produces a human readable version of the plural of a component type code. |
static java.lang.String |
typeToPlural(java.lang.String type)
Produces a human readable version of the plural of a component type code. |
static java.lang.String |
typeToString(int type)
Produces a human readable version of a component type code. |
boolean |
wellFormed(java.util.ArrayList trace)
Verifies if the trace is in descending order --by variable or image position. |
boolean |
wellFormed(java.util.ArrayList[] merge)
Verifies if the merge is in descending order --by variable or image position--. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int HEADER
public static final int BODY
public static final int CLOSING
public static final java.lang.String IMGTYPE
public static final java.lang.String VARTYPE
public boolean hasChanged
private int type
private int printType
private long code
private java.lang.String name
private java.util.ArrayList traceImages
private java.util.ArrayList traceVariables
private java.lang.String rtfText
traceImages
and traceVariables
). Those positions are related to
the document resulting from this text after it is read by the
corresponding swing component.private java.lang.String stamp
Constructor Detail |
public LetterComponent(int type, int printType)
type
and printType
. Moreover,
code
, name
, and stamp
are initialized to
"undefined".type
- The component type: BODY
, HEADER
,
CLOSING
.printType
- The component print type: LASER, TYPEWITTER.public LetterComponent(long code, int type, int printType, java.lang.String name, java.lang.String rtfText, java.util.ArrayList traceVariables, java.util.ArrayList traceImages, java.lang.String stamp)
code
- Component's code.type
- Component's type: HEADER, BODY, CLOSING.printType
- Component's print type: LASER, TYPEWRITTER.name
- Component's name.rtfText
- Component's rtf text.traceVariables
- Variables in the component.traceImages
- Images in the component.stamp
- Time stamp of the last time the component was saved.Method Detail |
public int getType()
type
public void setType(int type)
type
type
- The new type valuepublic int getPrintType()
printType
getPrintType
in interface LetterViewable
public void setPrintType(int printType)
printType
printType
- The new printType valuepublic long getCode()
code
getCode
in interface LetterViewable
public void setCode(long code)
code
code
- The new code valuepublic java.lang.String getName()
name
getName
in interface LetterViewable
public void setName(java.lang.String name)
name
name
- The new name valuepublic java.util.ArrayList getTraceImages()
traceImages
public void setTraceImages(java.util.ArrayList traceImages)
traceImages
traceImages
- The new traceImages valuepublic java.util.ArrayList getTraceVariables()
traceVariables
public void setTraceVariables(java.util.ArrayList traceVariables)
traceVariables
traceVariables
- The new traceVariables valuepublic java.lang.String getRtfText()
rtfText
public void setRtfText(java.lang.String rtfText)
rtfText
rtfText
- The new rtfText valuepublic java.lang.String getStamp()
stamp
public void setStamp(java.lang.String st)
stamp
st
- The new stamp valuepublic java.lang.String codesToString()
public static java.lang.String typeToString(int type)
type
- The component type code.public static java.lang.String typeToPlural(int type)
type
- The component type code.public static java.lang.String typeToPlural(java.lang.String type)
type
- The component type name.public java.util.ArrayList[] mergeVarsImages()
traceVariables
or traceImages
, according to the type.
public java.lang.String mergeToString(java.util.ArrayList[] merge)
merge
- The merge structure.public java.lang.String traceVarsToString()
public java.lang.String traceVarsToString(java.util.ArrayList trace)
trace
- public java.lang.String traceImgToString()
public java.lang.String traceImgToString(java.util.ArrayList trace)
trace
- public boolean wellFormed(java.util.ArrayList trace)
trace
- public boolean wellFormed(java.util.ArrayList[] merge)
merge
- A structure resulting from mergeVarsImages()
.public java.util.ArrayList[] getAllVariables()
public java.util.ArrayList[] getAllImages()
getAllImages
in interface LetterViewable
public java.lang.String extractRtf()
{\fonttbl\f0\fnil Monospaced;\f1\fnil Times New Roman;\f2\fnil Arial;}by something with actual font families like:
{\fonttbl\f0\fmodern Courier;\f1\froman Times;\f2\fswiss helvetica;}
public boolean hasVariables()
hasVariables
in interface LetterViewable
public java.lang.String toFoTemplate()
toFoTemplate
in interface LetterViewable
public java.util.ArrayList[] setOfVariables()
setOfVariables
in interface LetterViewable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |