org.exolab.castor.builder.printing

Class TemplateHelper


public class TemplateHelper
extends java.lang.Object

Helper class that provides convenience methods used by Velocity templates during JClass printing.

Method Summary

ArrayList
getLines(String comment)
Takes a comment string and splits it into lines that have the maximum length of 70 chars,
boolean
isEnum(JClass jClass)
Returns true if the JClass instance is instance of JEnum.
String
printAnnotation(JAnnotation annotation, String shift)
Converts the given JAnnotation to a string representation.
String
removeLineBreaks(String string)
Removes all line breaks from a given string.

Method Details

getLines

public ArrayList getLines(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 the JClass instance is instance of JEnum.
Parameters:
jClass - The JClass instance to check.
Returns:
true if instance of JEnum.

printAnnotation

public String printAnnotation(JAnnotation annotation,
                              String shift)
Converts the given JAnnotation to a string representation.
Parameters:
annotation - The annotation to translate.
shift - The intent.
Returns:
A string representation of the annotation.

removeLineBreaks

public String removeLineBreaks(String string)
Removes all line breaks from a given string.
Parameters:
string - The string containing line breaks.
Returns:
A string without line breaks.

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com