utility-macros 1.2

Summary

JPlate utility macros

Import Summary

Import Definitions
FileDescriptionComment
${jplate.LOCALE_HOME}/jplate-build-properties-messages.xmlImport local specific messages. Import locale specific messages.
common.xmlContains all JPlate common work. Import our common work...

Macro Definition Summary

Macro Definitions
NameDescriptionURI
assert-equalDetermines if @{str1} is equal to @{str2}. If the two are not equal, message defined in @{error-msg} is displayed.http://jplate.sourceforge.net/utility
assert-is-numberDetermines if @{number} is a number. If @{number} is not a number, @{error-msg} will be displayed.http://jplate.sourceforge.net/utility
assert-not-equalDetermines if @{str1} is not equal to @{str2}. If the two are equal, message defined in @{error-msg} is displayed.http://jplate.sourceforge.net/utility
assert-ref-idDetermines if @{ref-id} is a ref id and if not fails with an error message defined in @{error-msg}.http://jplate.sourceforge.net/utility
compute-branchCompute the branch based upon a root dir, @{root}, and full path, @{full-path}. The branch represents the full path minus the root dir. Please note: if @{root} does not exist in @{full-path}, @{property} will be set with an empty value.http://jplate.sourceforge.net/utility
compute-number-left-trimTrim preceeding 0's from @{number} and store in the property entitled @{property}.http://jplate.sourceforge.net/utility
compute-number-right-trimTrim ppostceeding 0's from @{number} after decimal and store in the property entitled @{property}.http://jplate.sourceforge.net/utility
compute-number-trimTrim ppostceeding 0's from @{number} after decimal and store in the property entitled @{property}.http://jplate.sourceforge.net/utility
compute-replacementReplace characters from @{str}. The characters to be replaced are contained in @{to-replace}. The replacement characters are contained in @{replacement}. The replaced data is stored in property @{property}. Please note if @{str} does not contain any data in @{to-replace} the value of @{property} will be @{str}.http://jplate.sourceforge.net/utility
compute-timestampCompute the current time stamp in YYYY-MM-DD_HH-MM-SS.http://jplate.sourceforge.net/utility
number-compareImplements a simplistic switch/case for comparing two numbers - less than, greater than, equal to or not equal.http://jplate.sourceforge.net/utility
process-listAllows one to iterate over a list/files and for each element in the list know the previous, current and next values.http://jplate.sourceforge.net/utility

Details

Macro Definition Details

assert-equal

Determines if @{str1} is equal to @{str2}. If the two are not equal, message defined in @{error-msg} is displayed.

Attribute Definitions
NameDescriptionDefault
str1Compared to @{str2}.Not Defined
str2Compared to @{str1}.Not Defined
error-msgThe message to display if @{str1} not equal to @{str2}.${jplate-utility.assert-equal.error-msg}
descriptionInformation about this macro call.Not Defined

assert-is-number

Determines if @{number} is a number. If @{number} is not a number, @{error-msg} will be displayed.

Attribute Definitions
NameDescriptionDefault
numberUsed to determine if a number or not.Not Defined
error-msgThe message to display if @{number} is not a number.${jplate-utility.assert-is-number.error-msg}
descriptionInformation about this macro call.Not Defined

assert-not-equal

Determines if @{str1} is not equal to @{str2}. If the two are equal, message defined in @{error-msg} is displayed.

Attribute Definitions
NameDescriptionDefault
str1Compared to @{str2}.Not Defined
str2Compared to @{str1}.Not Defined
error-msgThe message to display if @{str1} equals @{str2}.${jplate-utility.assert-not-equal.error-msg}
descriptionInformation about this macro call.Not Defined

assert-ref-id

Determines if @{ref-id} is a ref id and if not fails with an error message defined in @{error-msg}.

Attribute Definitions
NameDescriptionDefault
ref-idThe name of the ref id that should be a ref id.Not Defined
error-msgThe message to display if @{ref-id} is not a ref id.${jplate-utility.assert-ref-id.error-msg}
descriptionInformation about this macro call.Not Defined

compute-branch

Compute the branch based upon a root dir, @{root}, and full path, @{full-path}. The branch represents the full path minus the root dir. Please note: if @{root} does not exist in @{full-path}, @{property} will be set with an empty value.

Attribute Definitions
NameDescriptionDefault
rootThe root of the path defined in @{full-path}.Not Defined
full-pathThe absolute path for which @{root} is the root of the path and the branch computed is this path minus the root.Not Defined
propertyThe property to set with the branch.Not Defined
descriptionInformation about this macro call.Not Defined

compute-number-left-trim

Trim preceeding 0's from @{number} and store in the property entitled @{property}.

Attribute Definitions
NameDescriptionDefault
propertyThe name of the property to store the results of triming preceeding 0's from @{number}.Not Defined
numberThe number who will have preceeding 0's trimmed.Not Defined
descriptionInformation about this macro call.Not Defined

compute-number-right-trim

Trim ppostceeding 0's from @{number} after decimal and store in the property entitled @{property}.

Attribute Definitions
NameDescriptionDefault
propertyThe name of the property to store the results of triming postceeing 0's from decimal point from @{number}.Not Defined
numberThe number who will have preceeding 0's trimmed.Not Defined
descriptionInformation about this macro call.Not Defined

compute-number-trim

Trim ppostceeding 0's from @{number} after decimal and store in the property entitled @{property}.

Attribute Definitions
NameDescriptionDefault
propertyThe name of the property to store the results of triming postceeing 0's from decimal point from @{number}.Not Defined
numberThe number who will have preceeding 0's trimmed.Not Defined
descriptionInformation about this macro call.Not Defined

compute-replacement

Replace characters from @{str}. The characters to be replaced are contained in @{to-replace}. The replacement characters are contained in @{replacement}. The replaced data is stored in property @{property}. Please note if @{str} does not contain any data in @{to-replace} the value of @{property} will be @{str}.

Attribute Definitions
NameDescriptionDefault
strThe string containing characters to be replaced.Not Defined
to-replaceThe characters to replace in @{str}.Not Defined
replacementThe replacement characters that will replace @{to-replace} in @{str}.Not Defined
propertyThe name of the property to hold the replaced characters.Not Defined
descriptionInformation about this macro call.Not Defined

compute-timestamp

Compute the current time stamp in YYYY-MM-DD_HH-MM-SS.

Attribute Definitions
NameDescriptionDefault
propertyThe property to set with the current time stamp.Not Defined
prefixThe prefix for property when time stamp is computed and stored in @{property}.Not Defined
suffixThe suffix for property when time stamp is computed and stored in @{property}.Not Defined
descriptionInformation about this macro call.Not Defined

number-compare

Implements a simplistic switch/case for comparing two numbers - less than, greater than, equal to or not equal.

Attribute Definitions
NameDescriptionDefault
arg1Compared against @{arg2}.Not Defined
arg2Compared against @{arg1}.Not Defined
descriptionInformation about this macro call.Not Defined

process-list

Allows one to iterate over a list/files and for each element in the list know the previous, current and next values.

Attribute Definitions
NameDescriptionDefault
listThe list to process.Not Defined
delimiterThe delimiter for @{list}.,
previousName of property to hold previous value in list.jplate-utility.PREVIOUS
currentName of property to hold current value in list.jplate-utility.CURRENT
nextName of property to hold next value in list.jplate-utility.NEXT
descriptionInformation about this macro call.Not Defined



PrevUpNext