Class FieldsMetadata
java.lang.Object
fr.opensagres.xdocreport.template.formatter.FieldsMetadata
Fields Metadata is used in the preprocessing step to modify some XML entries like generate script (Freemarker,
Velocity...) for loop for Table row, generate script for Image...
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final FieldsMetadataprotected final List<FieldMetadata>protected final Map<String,FieldMetadata> protected final Map<String,FieldMetadata> protected final Map<String,FieldMetadata> -
Constructor Summary
ConstructorsConstructorDescriptionFieldsMetadata(TemplateEngineKind templateEngineKind) FieldsMetadata(String templateEngineKind) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomFormatter(ICustomFormatter customFormatter) Add custom formatter.addField(String fieldName, Boolean listType, String imageName, String syntaxKind, Boolean syntaxWithDirective) addFieldAsImage(String fieldName) Add a field name which is considered as an image.addFieldAsImage(String fieldName, boolean useImageSize) Add a field name which is considered as an image.addFieldAsImage(String fieldName, NullImageBehaviour behaviour) Add a field name which is considered as an image.addFieldAsImage(String fieldName, NullImageBehaviour behaviour, boolean useImageSize) Add a field name which is considered as an image.addFieldAsImage(String imageName, String fieldName) Add a field name which is considered as an image.addFieldAsImage(String imageName, String fieldName, boolean useImageSize) addFieldAsImage(String imageName, String fieldName, NullImageBehaviour behaviour) addFieldAsImage(String imageName, String fieldName, NullImageBehaviour behaviour, boolean useImageSize) Add a field name which is considered as an image.addFieldAsList(String fieldName) Add a field name which belongs to a list.addFieldAsTextStyling(String fieldName, fr.opensagres.xdocreport.core.document.SyntaxKind syntaxKind) Add a field name which can contains text stylink (Html, Wikipedia, etc..).addFieldAsTextStyling(String fieldName, fr.opensagres.xdocreport.core.document.SyntaxKind syntaxKind, boolean syntaxWithDirective) Add a field name which can contains text stylink (Html, Wikipedia, etc..).addFieldAsTextStyling(String fieldName, String syntaxKind) Add a field name which can contains text stylink (Html, Wikipedia, etc..).addFieldAsTextStyling(String fieldName, String syntaxKind, boolean syntaxWithDirective) Add a field name which can contains text stylink (Html, Wikipedia, etc..).voidaddFieldReplacement(String search, String replacement) Add field replacement.customFormat(String content, IDocumentFormatter formatter) Format the given content by using custom formatter.Returns the "global" behaviour to use when the stream of the image is null.Returns list of custom formatters and null otherwise.Returns the description of fields metadata.getFieldAsImage(String fieldName) getFieldAsTextStyling(String content) Returns the fields metadata as text styling from the given content and null otherwise.Returns list of fields metadata.Returns list of fields name which are considered as an image.Returns list of fields name which belongs to a list.Returns list of fields name which can contains text styling.getImageFieldName(String fieldName) Returns the template engine kind.booleanReturns true if there are fields as image and false otherwise.booleanReturns true if evaluation of the template engine should be done only for directive inserted in a field (MergeField for MS Word, Text-Inpout for ODT, etc) and false otherwise.booleanisFieldAsImage(String fieldName) booleanvoidLoad simple fields metadata in the given fieldsMetadata by using the given key and Java Class.voidLoad simple/list fields metadata in the given fieldsMetadata by using the given key and Java Class.voidsaveXML(OutputStream out) Serialize as XML without indentation the fields metadata to the givenOutputStream.voidsaveXML(OutputStream out, boolean indent) Serialize as XML the fields metadata to the givenOutputStream.voidSerialize as XML without indentation the fields metadata to the given XML writer.voidSerialize as XML the fields metadata to the given XML writer.voidSerialize as XML the fields metadata to the given XML writer.voidsetAfterRowToken(String afterRowToken) voidsetAfterTableCellToken(String afterTableCellToken) voidsetAfterTableToken(String afterTableToken) voidsetBeforeRowToken(String beforeRowToken) voidsetBeforeTableCellToken(String beforeTableCellToken) voidsetBeforeTableToken(String beforeTableToken) voidsetBehaviour(NullImageBehaviour behaviour) Set the "global" behaviour to use when the stream of the image is null.voidsetDescription(String description) Set the description of fields metadata.voidsetEvaluateEngineOnlyForFields(boolean evaluateEngineOnlyForFields) Set true if evaluation of the template engine should be done only for directive inserted in a field (MergeField for MS Word, Text-Inpout for ODT, etc) and false otherwises.voidsetTemplateEngineKind(String templateEngineKind) Set the template engine kind.voidsetUseImageSize(boolean useImageSize) toString()
-
Field Details
-
EMPTY
-
DEFAULT_BEFORE_TABLE_TOKEN
- See Also:
-
DEFAULT_AFTER_TABLE_TOKEN
- See Also:
-
DEFAULT_BEFORE_ROW_TOKEN
- See Also:
-
DEFAULT_AFTER_ROW_TOKEN
- See Also:
-
DEFAULT_BEFORE_TABLE_CELL_TOKEN
- See Also:
-
DEFAULT_AFTER_TABLE_CELL_TOKEN
- See Also:
-
fields
-
fieldsAsList
-
fieldsAsImage
-
fieldsAsTextStyling
-
-
Constructor Details
-
FieldsMetadata
public FieldsMetadata() -
FieldsMetadata
-
FieldsMetadata
-
-
Method Details
-
addFieldAsImage
Add a field name which is considered as an image.- Parameters:
fieldName-
-
addFieldAsImage
Add a field name which is considered as an image.- Parameters:
fieldName-
-
addFieldAsImage
Add a field name which is considered as an image.- Parameters:
fieldName-
-
addFieldAsImage
public FieldMetadata addFieldAsImage(String fieldName, NullImageBehaviour behaviour, boolean useImageSize) Add a field name which is considered as an image.- Parameters:
fieldName-
-
addFieldAsImage
Add a field name which is considered as an image.- Parameters:
imageName-fieldName-
-
addFieldAsImage
-
addFieldAsImage
public FieldMetadata addFieldAsImage(String imageName, String fieldName, NullImageBehaviour behaviour) -
addFieldAsImage
public FieldMetadata addFieldAsImage(String imageName, String fieldName, NullImageBehaviour behaviour, boolean useImageSize) Add a field name which is considered as an image.- Parameters:
imageName-fieldName-
-
addFieldAsTextStyling
public FieldMetadata addFieldAsTextStyling(String fieldName, fr.opensagres.xdocreport.core.document.SyntaxKind syntaxKind) Add a field name which can contains text stylink (Html, Wikipedia, etc..).- Parameters:
fieldName-syntaxKind-
-
addFieldAsTextStyling
public FieldMetadata addFieldAsTextStyling(String fieldName, fr.opensagres.xdocreport.core.document.SyntaxKind syntaxKind, boolean syntaxWithDirective) Add a field name which can contains text stylink (Html, Wikipedia, etc..).- Parameters:
fieldName-syntaxKind-
-
addFieldAsTextStyling
Add a field name which can contains text stylink (Html, Wikipedia, etc..).- Parameters:
fieldName-syntaxKind-
-
addFieldAsTextStyling
public FieldMetadata addFieldAsTextStyling(String fieldName, String syntaxKind, boolean syntaxWithDirective) Add a field name which can contains text stylink (Html, Wikipedia, etc..).- Parameters:
fieldName-syntaxKind-
-
addFieldAsList
Add a field name which belongs to a list.- Parameters:
fieldName-
-
addField
-
getFieldAsImage
-
getFieldsAsList
Returns list of fields name which belongs to a list.- Returns:
-
getFieldsAsImage
Returns list of fields name which are considered as an image.- Returns:
-
getFieldsAsTextStyling
Returns list of fields name which can contains text styling.- Returns:
-
getFieldAsTextStyling
Returns the fields metadata as text styling from the given content and null otherwise.- Parameters:
content-- Returns:
- the fields metadata as text styling from the given content and null otherwise.
-
hasFieldsAsImage
public boolean hasFieldsAsImage()Returns true if there are fields as image and false otherwise.- Returns:
-
isFieldAsImage
-
getImageFieldName
-
getBeforeTableToken
-
setBeforeTableToken
-
getAfterTableToken
-
setAfterTableToken
-
getBeforeRowToken
-
setBeforeRowToken
-
getAfterRowToken
-
setAfterRowToken
-
getBeforeTableCellToken
-
setBeforeTableCellToken
-
getAfterTableCellToken
-
setAfterTableCellToken
-
getFields
Returns list of fields metadata.- Returns:
-
saveXML
Serialize as XML without indentation the fields metadata to the given XML writer. Here a sample of XML writer :- Parameters:
writer-- Throws:
IOException
-
saveXML
Serialize as XML the fields metadata to the given XML writer. Here a sample of XML writer :- Parameters:
writer- XML writer.indent- true if indent must be managed and false otherwise.- Throws:
IOException
-
saveXML
Serialize as XML the fields metadata to the given XML writer. Here a sample of XML writer :- Parameters:
writer- XML writer.indent- true if indent must be managed and false otherwise.- Throws:
IOException
-
saveXML
Serialize as XML without indentation the fields metadata to the givenOutputStream. Here a sample of XML out:- Parameters:
writer-- Throws:
IOException
-
saveXML
Serialize as XML the fields metadata to the givenOutputStream. Here a sample of XML out :- Parameters:
writer- XML writer.indent- true if indent must be managed and false otherwise.- Throws:
IOException
-
load
public void load(String key, Class<?> clazz) throws fr.opensagres.xdocreport.core.XDocReportException Load simple fields metadata in the given fieldsMetadata by using the given key and Java Class.- Parameters:
key- the key (first token) to use to generate field name.clazz- the Java class model to use to load fields metadata.- Throws:
fr.opensagres.xdocreport.core.XDocReportException
-
load
public void load(String key, Class<?> clazz, boolean listType) throws fr.opensagres.xdocreport.core.XDocReportException Load simple/list fields metadata in the given fieldsMetadata by using the given key and Java Class.- Parameters:
key- the key (first token) to use to generate field name.clazz- the Java class model to use to load fields metadata.listType- true if it's a list and false otherwise.- Throws:
fr.opensagres.xdocreport.core.XDocReportException
-
toString
-
getDescription
Returns the description of fields metadata.- Returns:
-
setDescription
Set the description of fields metadata.- Parameters:
templateEngineKind-
-
getTemplateEngineKind
Returns the template engine kind.- Returns:
-
setTemplateEngineKind
Set the template engine kind.- Parameters:
templateEngineKind-
-
isEvaluateEngineOnlyForFields
public boolean isEvaluateEngineOnlyForFields()Returns true if evaluation of the template engine should be done only for directive inserted in a field (MergeField for MS Word, Text-Inpout for ODT, etc) and false otherwise.- Returns:
-
setEvaluateEngineOnlyForFields
public void setEvaluateEngineOnlyForFields(boolean evaluateEngineOnlyForFields) Set true if evaluation of the template engine should be done only for directive inserted in a field (MergeField for MS Word, Text-Inpout for ODT, etc) and false otherwises.- Parameters:
evaluateEngineOnlyForFields-
-
getBehaviour
Returns the "global" behaviour to use when the stream of the image is null.- Returns:
-
setBehaviour
Set the "global" behaviour to use when the stream of the image is null.- Parameters:
behaviour-
-
isUseImageSize
public boolean isUseImageSize() -
setUseImageSize
public void setUseImageSize(boolean useImageSize) -
addCustomFormatter
Add custom formatter.- Parameters:
customFormatter-
-
getCustomFormatter
Returns list of custom formatters and null otherwise.- Returns:
-
addFieldReplacement
Add field replacement.- Parameters:
search-replacement-
-
customFormat
Format the given content by using custom formatter.- Parameters:
content-formatter-- Returns:
-