|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.control.print.LyContentReplacer
public class LyContentReplacer
This class Reads a file (Ascii, XML, RTF, HTML ...) and replace some keys inside the file pattern like $KEY$ to produce an output file with content.
Field Summary | |
---|---|
static java.lang.String |
__VERSION
File version |
static int |
DISPLAY_VALUE_INTERNAL
Display parameter to indicate what to display in the value of a field : internal value (fieldValue.getString()). |
static int |
DISPLAY_VALUE_NAME
Display parameter to indicate what to display in the value of a field : default is value name (fieldValue.getName()). |
static int |
DISPLAY_VALUE_SHORT_NAME
Display parameter to indicate what to display in the value of a field : short name value (fieldValue.getShortName()). |
static java.lang.String |
ESCAPE_ENCODE_SEP
Escape encode character |
static java.lang.String |
FIELDINFO_SEP
Fieldinfo separator |
static java.lang.String |
FIELDNAME_SEP
Field name separator |
static java.lang.String |
IF_FIRST_OBJECT_END
IF_FIRST_OBJECT_END Tag |
static java.lang.String |
IF_FIRST_OBJECT_START
IF_FIRST_OBJECT_START Tag |
static java.lang.String |
IF_LAST_OBJECT_END
IF_LAST_OBJECT_END Tag |
static java.lang.String |
IF_LAST_OBJECT_START
IF_LAST_OBJECT_START tag |
static java.lang.String |
IF_NOT_FIRST_OBJECT_END
IF_NOT_FIRST_OBJECT_END Tag |
static java.lang.String |
IF_NOT_FIRST_OBJECT_START
IF_NOT_FIRST_OBJECT_START Tag |
static java.lang.String |
IF_NOT_LAST_OBJECT_END
IF_NOT_LAST_OBJECT_END Tag |
static java.lang.String |
IF_NOT_LAST_OBJECT_START
IF_NOT_LAST_OBJECT_START Tag |
static int |
MODE_HTML
Replacing mode for encoding : HTML (html encoding). |
static int |
MODE_RTF
Replacing mode for encoding : RTF (rtf encoding). |
static int |
MODE_TEXT
Replacing mode for encoding : text (no encoding). |
static int |
MODE_XML
Replacing mode for encoding : XML (xml encoding). |
static java.lang.String |
REPEAT_OBJECT_END
REPEAT_OBJECT_ENDt Tag |
static java.lang.String |
REPEAT_OBJECT_START
REPEAT_OBJECT_START Tag |
static java.lang.String |
SORT_ID
|
Constructor Summary | |
---|---|
LyContentReplacer(LyEnvironment environment)
Constructor. |
Method Summary | |
---|---|
java.lang.String |
clearIndexFromKey(java.lang.String key)
Get the Key name without the index information index is like fieldInfoId[index]. |
java.lang.String |
encodeString(java.lang.String value)
Encode the string for the target output. |
java.lang.String |
format(java.lang.String text,
int step)
Format the given text |
java.lang.String |
format(java.lang.String text,
int step,
boolean fill,
char filling_char,
boolean replace_cr)
Format a string to a maximum width with new lines inserted every 'step' position. |
int |
generateContentFromModel(LyObjectList objects,
java.io.PrintWriter writer)
Generate the content for the specified object and write it to the output. |
java.lang.String |
getContentFromModel(LyObject object)
Get the content fromt the model. |
java.lang.String |
getContentFromModel(LyObjectList objects)
Get the result of the transformation as a String. |
int |
getIndexFromKey(java.lang.String key)
Get the specified index for the key index is like fieldInfoId[index]. |
int |
getMode()
Accessor to Current mode file. |
java.lang.String |
getModelFile()
Accessor to Current model file. |
LyObjectList |
getObjectListFromInterpreter(java.lang.String[] keys,
LyObjectList objects,
int depth)
get the list of value from the interpreter within current context. |
java.util.Hashtable<java.lang.String,java.lang.String> |
getRootDictionnary()
accessor to the original dictionnary. |
java.lang.String |
getString(LyValue value,
java.lang.String separator)
Utility method to get a multipleValue as a String with a separator. |
java.lang.String |
getValueFromInterpreter(java.lang.String[] keys,
LyObjectList objects,
java.util.Vector<LyObjectList> parentContextStack,
int depth,
int display)
get the value from the interpreter within current context. |
boolean |
isDisplayed(LyFieldInfo fieldInfo)
Utility method to know if a fieldInfo is displayed in this result or not. |
int |
matchPatterns(LyObjectList objects,
java.lang.String model,
java.io.PrintWriter writer,
java.util.Hashtable<java.lang.String,java.lang.String> dict,
char tag,
java.util.Vector<LyObjectList> parentContextStack,
int writeOutputDisabled)
Enables pattern matching in a file. |
void |
setModelFile(java.lang.String modelFile)
Accessor to Current model file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public static java.lang.String ESCAPE_ENCODE_SEP
public static java.lang.String FIELDINFO_SEP
public static java.lang.String FIELDNAME_SEP
public static java.lang.String REPEAT_OBJECT_START
public static java.lang.String REPEAT_OBJECT_END
public static java.lang.String IF_LAST_OBJECT_START
public static java.lang.String IF_LAST_OBJECT_END
public static java.lang.String IF_NOT_LAST_OBJECT_START
public static java.lang.String IF_NOT_LAST_OBJECT_END
public static java.lang.String IF_FIRST_OBJECT_START
public static java.lang.String IF_FIRST_OBJECT_END
public static java.lang.String IF_NOT_FIRST_OBJECT_START
public static java.lang.String IF_NOT_FIRST_OBJECT_END
public static java.lang.String SORT_ID
public static final int MODE_TEXT
public static final int MODE_HTML
public static final int MODE_RTF
public static final int MODE_XML
public static final int DISPLAY_VALUE_NAME
public static final int DISPLAY_VALUE_SHORT_NAME
public static final int DISPLAY_VALUE_INTERNAL
Constructor Detail |
---|
public LyContentReplacer(LyEnvironment environment)
environment
- the current environmentMethod Detail |
---|
public java.lang.String getContentFromModel(LyObject object)
object
- current model
public java.lang.String getContentFromModel(LyObjectList objects)
objects
- current value to build replacement dictionnary
public java.util.Hashtable<java.lang.String,java.lang.String> getRootDictionnary()
public int generateContentFromModel(LyObjectList objects, java.io.PrintWriter writer) throws java.io.IOException
objects
- current objects used for content replacementwriter
- current writer for the output
java.io.IOException
public java.lang.String getModelFile()
public void setModelFile(java.lang.String modelFile)
modelFile
- current model filepublic boolean isDisplayed(LyFieldInfo fieldInfo)
These fields should never be shown to the user.
fieldInfo
- the fieldInfo which is tested for addition in the view.
public java.lang.String getString(LyValue value, java.lang.String separator)
value
- value to convert as a Stringseparator
- separator between values
public java.lang.String format(java.lang.String text, int step, boolean fill, char filling_char, boolean replace_cr)
text
- char string to displaystep
- nmber of characters for new line insertfill
- indicates if the string is filled at the end with filling_charfilling_char
- filling char for the end of the Stringreplace_cr
- indicate if \n are replaced by blanks or not.
public java.lang.String format(java.lang.String text, int step)
text
- the textstep
- a step
public int matchPatterns(LyObjectList objects, java.lang.String model, java.io.PrintWriter writer, java.util.Hashtable<java.lang.String,java.lang.String> dict, char tag, java.util.Vector<LyObjectList> parentContextStack, int writeOutputDisabled)
objects
- a list of objectsmodel
- original content for substitutionwriter
- result streamdict
- pattern matching dictionnarytag
- tag delimiter -it is *2 in the model, like '@@')parentContextStack
- this is the stack of context (null by default at root level) for
loops.writeOutputDisabled
- counters for write disable requesters : must be 0 at root level
public java.lang.String getValueFromInterpreter(java.lang.String[] keys, LyObjectList objects, java.util.Vector<LyObjectList> parentContextStack, int depth, int display)
keys
- the tags to extract from contextobjects
- current contextparentContextStack
- the stack of all parent context (to go up with '..' in interpreter)depth
- current depth in analysis of keysdisplay
- indicates what to display:one of the DISPLAY_VALUE_xxx constants
public LyObjectList getObjectListFromInterpreter(java.lang.String[] keys, LyObjectList objects, int depth)
keys
- the tag to extract from contextobjects
- current contextdepth
- current depth in analysis of keys
public int getIndexFromKey(java.lang.String key)
key
- the key to parse
public java.lang.String clearIndexFromKey(java.lang.String key)
key
- the key to parse
public java.lang.String encodeString(java.lang.String value)
value
- the value to encode
public int getMode()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |