Class TemplateHelper
- java.lang.Object
-
- org.exolab.castor.builder.printing.TemplateHelper
-
public class TemplateHelper extends java.lang.ObjectHelper class that provides convenience methods used by Velocity templates duringJClassprinting.
-
-
Constructor Summary
Constructors Constructor Description TemplateHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.ArrayList<java.lang.String>getLines(java.lang.String comment)Takes a comment string and splits it into lines that have the maximum length of 70 chars,booleanisEnum(JClass jClass)Returns true if theJClassinstance is instance of JEnum.java.lang.StringprintAnnotation(JAnnotation annotation, java.lang.String shift)Converts the givenJAnnotationto a string representation.java.lang.StringremoveLineBreaks(java.lang.String string)Removes all line breaks from a given string.
-
-
-
Method Detail
-
removeLineBreaks
public java.lang.String removeLineBreaks(java.lang.String string)
Removes all line breaks from a given string.- Parameters:
string- The string containing line breaks.- Returns:
- A string without line breaks.
-
getLines
public java.util.ArrayList<java.lang.String> getLines(java.lang.String comment)
Takes a comment string and splits it into lines that have the maximum length of 70 chars,- Parameters:
comment- The comment as string.- Returns:
- The comment string splitted into a list.
-
isEnum
public boolean isEnum(JClass jClass)
Returns true if theJClassinstance is instance of JEnum.- Parameters:
jClass- TheJClassinstance to check.- Returns:
- true if instance of JEnum.
-
printAnnotation
public java.lang.String printAnnotation(JAnnotation annotation, java.lang.String shift)
Converts the givenJAnnotationto a string representation.- Parameters:
annotation- The annotation to translate.shift- The intent.- Returns:
- A string representation of the annotation.
-
-