public class JomcTool extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JomcTool.Listener
Listener interface.
|
Constructor and Description |
---|
JomcTool()
Creates a new
JomcTool instance. |
JomcTool(JomcTool tool)
Creates a new
JomcTool instance taking a JomcTool instance to initialize the new instance with. |
Modifier and Type | Method and Description |
---|---|
String |
getBooleanString(Boolean b)
Formats a
Boolean to a string. |
String |
getCsvString(String str)
Formats a string to a CSV string.
|
static Level |
getDefaultLogLevel()
Gets the default log level events are logged at.
|
String |
getDefaultTemplateEncoding()
Gets the default encoding used for reading templates.
|
static String |
getDefaultTemplateProfile()
Deprecated.
The
static modifier of this method and support to setup the default template profile using
a system property will be removed in version 2.0. |
String |
getDisplayLanguage(String language)
Gets the display language of a given language code.
|
String |
getHtmlString(String str)
Formats a string to a HTML string with HTML entities.
|
List<String> |
getImplementedJavaTypeNames(Implementation implementation,
boolean qualified)
Gets a list of names of all Java types an implementation implements.
|
String |
getIndentation()
Gets the indentation string of the instance.
|
String |
getIndentation(int level)
Gets an indentation string for a given indentation level.
|
String |
getInputEncoding()
Gets the encoding to use for reading files.
|
String |
getIsoDate(Calendar calendar)
Formats a calendar instance to a string.
|
String |
getIsoDateTime(Calendar calendar)
Formats a calendar instance to a string.
|
String |
getIsoTime(Calendar calendar)
Formats a calendar instance to a string.
|
String |
getJavaClasspathLocation(Implementation implementation)
Gets the Java class path location of an implementation.
|
String |
getJavaClasspathLocation(Specification specification)
Gets the Java class path location of a specification.
|
String |
getJavaClasspathLocation(String str,
boolean absolute)
Formats a string to a Java class path location.
|
String |
getJavaConstantName(String str)
Formats a string to a Java constant name.
|
String |
getJavadocComment(Text text,
int indentationLevel,
String linePrefix)
Formats a text to a Javadoc comment.
|
String |
getJavadocComment(Texts texts,
int indentationLevel,
String linePrefix)
Formats a text from a list of texts to a Javadoc comment.
|
String |
getJavaFieldName(Dependency dependency)
Gets a Java field name of a dependency.
|
String |
getJavaFieldName(Message message)
Gets a Java field name of a message.
|
String |
getJavaFieldName(Property property)
Gets a Java field name of a property.
|
String |
getJavaFieldName(String str)
Formats a string to a Java field name.
|
String |
getJavaGetterMethodName(Dependency dependency)
Gets the name of a Java getter method of a given dependency.
|
String |
getJavaGetterMethodName(Message message)
Gets the name of a Java getter method of a given message.
|
String |
getJavaGetterMethodName(Property property)
Gets the name of a Java getter method of a given property.
|
String |
getJavaIdentifier(String str,
boolean capitalize)
Formats a string to a Java identifier.
|
List<String> |
getJavaInterfaceNames(Implementation implementation,
boolean qualified)
Deprecated.
As of JOMC 1.2, replaced by method
getImplementedJavaTypeNames(org.jomc.model.Implementation, boolean) .
This method will be removed in version 2.0. |
String |
getJavaMethodParameterName(Argument argument)
Gets a Java method parameter name of an argument.
|
String |
getJavaMethodParameterName(Dependency dependency)
Gets a Java method parameter name of a dependency.
|
String |
getJavaMethodParameterName(Message message)
Gets a Java method parameter name of a message.
|
String |
getJavaMethodParameterName(Property property)
Gets a Java method parameter name of a property.
|
String |
getJavaMethodParameterName(String str)
Formats a string to a Java method parameter name.
|
String |
getJavaModifierName(Implementation implementation,
Dependency dependency)
Gets the Java modifier name of a dependency of a given implementation.
|
String |
getJavaModifierName(Implementation implementation,
Message message)
Gets the Java modifier name of a message of a given implementation.
|
String |
getJavaModifierName(Implementation implementation,
Property property)
Gets the Java modifier name of a property of a given implementation.
|
String |
getJavaPackageName(Implementation implementation)
Gets the Java package name of an implementation.
|
String |
getJavaPackageName(Specification specification)
Gets the Java package name of a specification.
|
String |
getJavaPackageName(SpecificationReference reference)
Gets the Java package name of a specification reference.
|
String |
getJavaScriptString(String str)
Formats a string to a JavaScript string applying JavaScript string rules.
|
String |
getJavaSetterMethodName(Dependency dependency)
Gets the name of a Java setter method of a given dependency.
|
String |
getJavaSetterMethodName(Message message)
Gets the name of a Java setter method of a given message.
|
String |
getJavaSetterMethodName(Property property)
Gets the name of a Java setter method of a given property.
|
String |
getJavaString(String str)
Formats a string to a Java string with unicode escapes.
|
String |
getJavaTypeName(Argument argument)
Gets the Java type name of an argument.
|
String |
getJavaTypeName(Dependency dependency)
Gets the name of a Java type of a given dependency.
|
String |
getJavaTypeName(Implementation implementation,
boolean qualified)
Gets the Java type name of an implementation.
|
String |
getJavaTypeName(Property property,
boolean boxify)
Gets the Java type name of a property.
|
String |
getJavaTypeName(Specification specification,
boolean qualified)
Gets the Java type name of a specification.
|
String |
getJavaTypeName(SpecificationReference reference,
boolean qualified)
Gets the name of a Java type of a given specification reference.
|
String |
getLineSeparator()
Gets the line separator of the instance.
|
List<JomcTool.Listener> |
getListeners()
Gets the list of registered listeners.
|
Locale |
getLocale()
Gets the locale of the instance.
|
Level |
getLogLevel()
Gets the log level of the instance.
|
String |
getLongDate(Calendar calendar)
Formats a calendar instance to a string.
|
String |
getLongDateTime(Calendar calendar)
Formats a calendar instance to a string.
|
String |
getLongTime(Calendar calendar)
Formats a calendar instance to a string.
|
String |
getMediumDate(Calendar calendar)
Formats a calendar instance to a string.
|
String |
getMediumDateTime(Calendar calendar)
Formats a calendar instance to a string.
|
String |
getMediumTime(Calendar calendar)
Formats a calendar instance to a string.
|
Model |
getModel()
Gets the model of the instance.
|
Modules |
getModules()
Gets the modules of the model of the instance.
|
String |
getOutputEncoding()
Gets the encoding to use for writing files.
|
String |
getParentTemplateProfile(String tp)
Gets the parent template profile of a given template profile.
|
String |
getShortDate(Calendar calendar)
Formats a calendar instance to a string.
|
String |
getShortDateTime(Calendar calendar)
Formats a calendar instance to a string.
|
String |
getShortTime(Calendar calendar)
Formats a calendar instance to a string.
|
String |
getSqlString(String str)
Formats a string to a SQL string.
|
String |
getTemplateEncoding()
Deprecated.
As of JOMC 1.3, replaced by method
getDefaultTemplateEncoding() . This method will be removed
in JOMC 2.0. |
String |
getTemplateEncoding(String tp)
Gets the template encoding of a given template profile.
|
URL |
getTemplateLocation()
Gets the location to search for templates in addition to searching the class path.
|
Map<String,Object> |
getTemplateParameters()
Gets the template parameters of the instance.
|
String |
getTemplateProfile()
Gets the template profile of the instance.
|
VelocityContext |
getVelocityContext()
Gets a new velocity context used for merging templates.
|
VelocityEngine |
getVelocityEngine()
Gets the
VelocityEngine of the instance. |
Template |
getVelocityTemplate(String templateName)
Gets a velocity template for a given name.
|
String |
getXmlString(String str)
Formats a string to a XML string with XML entities.
|
String |
getYears(Calendar start,
Calendar end)
Gets a string describing the range of years for given calendars.
|
boolean |
isJavaDefaultPackage(Implementation implementation)
Gets a flag indicating the class of a given implementation is located in the Java default package.
|
boolean |
isJavaDefaultPackage(Specification specification)
Gets a flag indicating the class of a given specification is located in the Java default package.
|
boolean |
isJavaPrimitiveType(Property property)
Gets a flag indicating the type of a given property is a Java primitive.
|
boolean |
isLoggable(Level level)
Checks if a message at a given level is provided to the listeners of the instance.
|
void |
log(Level level,
String message,
Throwable throwable)
Notifies registered listeners.
|
static void |
setDefaultLogLevel(Level value)
Sets the default log level events are logged at.
|
void |
setDefaultTemplateEncoding(String value)
Sets the default encoding to use for reading templates.
|
static void |
setDefaultTemplateProfile(String value)
Deprecated.
The
static modifier of this method will be removed in version 2.0. |
void |
setIndentation(String value)
Sets the indentation string of the instance.
|
void |
setInputEncoding(String value)
Sets the encoding to use for reading files.
|
void |
setLineSeparator(String value)
Sets the line separator of the instance.
|
void |
setLocale(Locale value)
Sets the locale of the instance.
|
void |
setLogLevel(Level value)
Sets the log level of the instance.
|
void |
setModel(Model value)
Sets the model of the instance.
|
void |
setOutputEncoding(String value)
Sets the encoding to use for writing files.
|
void |
setTemplateEncoding(String value)
Deprecated.
As of JOMC 1.3, replaced by method
setDefaultTemplateEncoding(java.lang.String) . This method
will be removed in JOMC 2.0. |
void |
setTemplateLocation(URL value)
Sets the location to search for templates in addition to searching the class path.
|
void |
setTemplateProfile(String value)
Sets the template profile of the instance.
|
void |
setVelocityEngine(VelocityEngine value)
Sets the
VelocityEngine of the instance. |
public JomcTool()
JomcTool
instance.public JomcTool(JomcTool tool) throws IOException
JomcTool
instance taking a JomcTool
instance to initialize the new instance with.tool
- The instance to initialize the new instance with.NullPointerException
- if tool
is null
.IOException
- if copying tool
fails.public List<JomcTool.Listener> getListeners()
This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make
to the returned list will be present inside the object. This is why there is no set
method for the
listeners property.
log(java.util.logging.Level, java.lang.String, java.lang.Throwable)
public static Level getDefaultLogLevel()
The default log level is controlled by system property org.jomc.tools.JomcTool.defaultLogLevel
holding
the log level to log events at by default. If that property is not set, the WARNING
default is
returned.
getLogLevel()
,
Level.parse(java.lang.String)
public static void setDefaultLogLevel(Level value)
value
- The new default level events are logged at or null
.getDefaultLogLevel()
public final Level getLogLevel()
getDefaultLogLevel()
,
setLogLevel(java.util.logging.Level)
,
isLoggable(java.util.logging.Level)
public final void setLogLevel(Level value)
value
- The new log level of the instance or null
.getLogLevel()
,
isLoggable(java.util.logging.Level)
public boolean isLoggable(Level level)
level
- The level to test.true
, if messages at level
are provided to the listeners of the instance;
false
, if messages at level
are not provided to the listeners of the instance.NullPointerException
- if level
is null
.getLogLevel()
,
setLogLevel(java.util.logging.Level)
,
log(java.util.logging.Level, java.lang.String, java.lang.Throwable)
public String getJavaPackageName(Specification specification)
specification
- The specification to get the Java package name of.specification
or null
.NullPointerException
- if specification
is null
.public String getJavaTypeName(Specification specification, boolean qualified)
specification
- The specification to get the Java type name of.qualified
- true
, to return the fully qualified type name (with package name prepended);
false
, to return the short type name (without package name prepended).specification
or null
.NullPointerException
- if specification
is null
.getJavaPackageName(org.jomc.model.Specification)
public String getJavaClasspathLocation(Specification specification)
specification
- The specification to return the Java class path location of.specification
or null
.NullPointerException
- if specification
is null
.getJavaTypeName(org.jomc.model.Specification, boolean)
,
getJavaClasspathLocation(java.lang.String, boolean)
public String getJavaPackageName(SpecificationReference reference)
reference
- The specification reference to get the Java package name of.reference
or null
.NullPointerException
- if reference
is null
.getJavaPackageName(org.jomc.model.Specification)
public String getJavaTypeName(SpecificationReference reference, boolean qualified)
reference
- The specification reference to get a Java type name of.qualified
- true
, to return the fully qualified type name (with package name prepended);
false
, to return the short type name (without package name prepended).reference
or null
.NullPointerException
- if reference
is null
.getJavaTypeName(org.jomc.model.Specification, boolean)
public String getJavaPackageName(Implementation implementation)
implementation
- The implementation to get the Java package name of.implementation
or null
.NullPointerException
- if implementation
is null
.public String getJavaTypeName(Implementation implementation, boolean qualified)
implementation
- The implementation to get the Java type name of.qualified
- true
, to return the fully qualified type name (with package name prepended);
false
, to return the short type name (without package name prepended).implementation
or null
.NullPointerException
- if implementation
is null
.getJavaPackageName(org.jomc.model.Implementation)
public String getJavaClasspathLocation(Implementation implementation)
implementation
- The implementation to return the Java class path location of.implementation
or null
.NullPointerException
- if implementation
is null
.getJavaClasspathLocation(java.lang.String, boolean)
@Deprecated public List<String> getJavaInterfaceNames(Implementation implementation, boolean qualified)
getImplementedJavaTypeNames(org.jomc.model.Implementation, boolean)
.
This method will be removed in version 2.0.implementation
- The implementation to get names of all implemented Java types of.qualified
- true
, to return the fully qualified type names (with package name prepended);
false
, to return the short type names (without package name prepended).implementation
.NullPointerException
- if implementation
is null
.public List<String> getImplementedJavaTypeNames(Implementation implementation, boolean qualified)
implementation
- The implementation to get names of all implemented Java types of.qualified
- true
, to return the fully qualified type names (with package name prepended);
false
, to return the short type names (without package name prepended).implementation
.NullPointerException
- if implementation
is null
.getJavaTypeName(org.jomc.model.Specification, boolean)
public String getJavaTypeName(Argument argument)
argument
- The argument to get the Java type name of.argument
.NullPointerException
- if argument
is null
.public String getJavaMethodParameterName(Argument argument)
argument
- The argument to get the Java method parameter name of.argument
.NullPointerException
- if argument
is null
.getJavaMethodParameterName(java.lang.String)
public String getJavaTypeName(Property property, boolean boxify)
property
- The property to get the Java type name of.boxify
- true
, to return the name of the Java wrapper class when the type is a Java primitive type;
false
, to return the exact binary name (unboxed name) of the Java type.property
.NullPointerException
- if property
is null
.public boolean isJavaPrimitiveType(Property property)
property
- The property to query.true
, if the Java type of property
is primitive; false
, if not.NullPointerException
- if property
is null
.getJavaTypeName(org.jomc.model.Property, boolean)
public String getJavaGetterMethodName(Property property)
property
- The property to get a Java getter method name of.property
.NullPointerException
- if property
is null
.getJavaIdentifier(java.lang.String, boolean)
public String getJavaSetterMethodName(Property property)
property
- The property to get a Java setter method name of.property
.NullPointerException
- if property
is null
.getJavaIdentifier(java.lang.String, boolean)
public String getJavaMethodParameterName(Property property)
property
- The property to get the Java method parameter name of.property
.NullPointerException
- if property
is null
.getJavaMethodParameterName(java.lang.String)
public String getJavaFieldName(Property property)
property
- The property to get the Java field name of.property
.NullPointerException
- if property
is null
.getJavaFieldName(java.lang.String)
public String getJavaTypeName(Dependency dependency)
dependency
- The dependency to get a dependency Java type name of.dependency
or null
.NullPointerException
- if dependency
is null
.getJavaTypeName(org.jomc.model.Specification, boolean)
public String getJavaGetterMethodName(Dependency dependency)
dependency
- The dependency to get a Java getter method name of.dependency
.NullPointerException
- if dependency
is null
.getJavaIdentifier(java.lang.String, boolean)
public String getJavaSetterMethodName(Dependency dependency)
dependency
- The dependency to get a Java setter method name of.dependency
.NullPointerException
- if dependency
is null
.getJavaIdentifier(java.lang.String, boolean)
public String getJavaMethodParameterName(Dependency dependency)
dependency
- The dependency to get the Java method parameter name of.dependency
.NullPointerException
- if dependency
is null
.getJavaMethodParameterName(java.lang.String)
public String getJavaFieldName(Dependency dependency)
dependency
- The dependency to get the Java field name of.dependency
.NullPointerException
- if dependency
is null
.getJavaFieldName(java.lang.String)
public String getJavaGetterMethodName(Message message)
message
- The message to get a Java getter method name of.message
.NullPointerException
- if message
is null
.getJavaIdentifier(java.lang.String, boolean)
public String getJavaSetterMethodName(Message message)
message
- The message to get a Java setter method name of.message
.NullPointerException
- if message
is null
.getJavaIdentifier(java.lang.String, boolean)
public String getJavaMethodParameterName(Message message)
message
- The message to get the Java method parameter name of.message
.NullPointerException
- if message
is null
.getJavaMethodParameterName(java.lang.String)
public String getJavaFieldName(Message message)
message
- The message to get the Java field name of.message
.NullPointerException
- if message
is null
.getJavaFieldName(java.lang.String)
public String getJavaModifierName(Implementation implementation, Dependency dependency)
implementation
- The implementation declaring the dependency to get a Java modifier name of.dependency
- The dependency to get a Java modifier name of.dependency
of implementation
.NullPointerException
- if implementation
or dependency
is null
.public String getJavaModifierName(Implementation implementation, Message message)
implementation
- The implementation declaring the message to get a Java modifier name of.message
- The message to get a Java modifier name of.message
of implementation
.NullPointerException
- if implementation
or message
is null
.public String getJavaModifierName(Implementation implementation, Property property)
implementation
- The implementation declaring the property to get a Java modifier name of.property
- The property to get a Java modifier name of.property
of implementation
.NullPointerException
- if implementation
or property
is null
.public String getJavadocComment(Text text, int indentationLevel, String linePrefix)
text
- The text to format to a Javadoc comment.indentationLevel
- The indentation level of the comment.linePrefix
- The text to prepend lines with.text
formatted to a Javadoc comment.NullPointerException
- if text
or linePrefix
is null
.IllegalArgumentException
- if indentationLevel
is negative.public String getJavadocComment(Texts texts, int indentationLevel, String linePrefix)
texts
- The list of texts to format to a Javadoc comment.indentationLevel
- The indentation level of the comment.linePrefix
- The text to prepend lines with.NullPointerException
- if texts
or linePrefix
is null
.IllegalArgumentException
- if indentationLevel
is negative.getLocale()
public String getJavaString(String str)
str
- The string to format to a Java string or null
.str
formatted to a Java string or null
.StringEscapeUtils.escapeJava(java.lang.String)
public String getJavaClasspathLocation(String str, boolean absolute)
str
- The string to format or null
.absolute
- true
to return an absolute class path location; false
to return a relative
class path location.str
formatted to a Java class path location.public String getJavaIdentifier(String str, boolean capitalize)
str
- The string to format or null
.capitalize
- true
, to return an identifier with the first character upper cased; false
, to
return an identifier with the first character lower cased.str
formatted to a Java identifier or null
.public String getJavaMethodParameterName(String str)
str
- The string to format or null
.str
formatted to a Java method parameter name or null
.public String getJavaFieldName(String str)
str
- The string to format or null
.str
formatted to a Java field name or null
.public String getJavaConstantName(String str)
str
- The string to format or null
.str
formatted to a Java constant name or null
.public boolean isJavaDefaultPackage(Specification specification)
specification
- The specification to query.true
, if the class of specification
is located in the Java default package;
false
, else.NullPointerException
- if specification
is null
.public boolean isJavaDefaultPackage(Implementation implementation)
implementation
- The implementation to query.true
, if the class of implementation
is located in the Java default package;
false
, else.NullPointerException
- if implementation
is null
.public String getHtmlString(String str)
str
- The string to format to a HTML string with HTML entities or null
.str
formatted to a HTML string with HTML entities or null
.StringEscapeUtils.escapeHtml(java.lang.String)
public String getXmlString(String str)
str
- The string to format to a XML string with XML entities or null
.str
formatted to a XML string with XML entities or null
.StringEscapeUtils.escapeXml(java.lang.String)
public String getJavaScriptString(String str)
str
- The string to format to a JavaScript string by applying JavaScript string rules or null
.str
formatted to a JavaScript string with JavaScript string rules applied or null
.StringEscapeUtils.escapeJavaScript(java.lang.String)
public String getSqlString(String str)
str
- The string to format to a SQL string or null
.str
formatted to a SQL string or null
.StringEscapeUtils.escapeSql(java.lang.String)
public String getCsvString(String str)
str
- The string to format to a CSV string or null
.str
formatted to a CSV string or null
.StringEscapeUtils.escapeCsv(java.lang.String)
public String getBooleanString(Boolean b)
Boolean
to a string.b
- The Boolean
to format to a string or null
.b
formatted to a string.getLocale()
public String getDisplayLanguage(String language)
language
- The language code to get the display language of.language
.NullPointerException
- if language
is null
.public String getShortDate(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using a short format style pattern.NullPointerException
- if calendar
is null
.DateFormat.SHORT
public String getMediumDate(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using a medium format style pattern.NullPointerException
- if calendar
is null
.DateFormat.MEDIUM
public String getLongDate(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using a long format style pattern.NullPointerException
- if calendar
is null
.DateFormat.LONG
public String getIsoDate(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using an ISO-8601 format style.NullPointerException
- if calendar
is null
.yyyy-DDD
public String getShortTime(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using a short format style pattern.NullPointerException
- if calendar
is null
.DateFormat.SHORT
public String getMediumTime(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using a medium format style pattern.NullPointerException
- if calendar
is null
.DateFormat.MEDIUM
public String getLongTime(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using a long format style pattern.NullPointerException
- if calendar
is null
.DateFormat.LONG
public String getIsoTime(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using an ISO-8601 format style.NullPointerException
- if calendar
is null
.HH:mm
public String getShortDateTime(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using a short format style pattern.NullPointerException
- if calendar
is null
.DateFormat.SHORT
public String getMediumDateTime(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using a medium format style pattern.NullPointerException
- if calendar
is null
.DateFormat.MEDIUM
public String getLongDateTime(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using a long format style pattern.NullPointerException
- if calendar
is null
.DateFormat.LONG
public String getIsoDateTime(Calendar calendar)
calendar
- The calendar to format to a string.calendar
formatted using a ISO-8601 format style.NullPointerException
- if calendar
is null
.yyyy-MM-dd'T'HH:mm:ssZ
public String getYears(Calendar start, Calendar end)
start
- The start of the range.end
- The end of the range.start
and end
(e.g. "start - end"
).NullPointerException
- if start
or end
is null
.public final Model getModel()
getModules()
,
setModel(org.jomc.modlet.Model)
public final void setModel(Model value)
value
- The new model of the instance or null
.getModel()
public final Modules getModules()
null
, if no modules are found.getModel()
,
setModel(org.jomc.modlet.Model)
public final VelocityEngine getVelocityEngine() throws IOException
VelocityEngine
of the instance.VelocityEngine
of the instance.IOException
- if initializing a new velocity engine fails.setVelocityEngine(org.apache.velocity.app.VelocityEngine)
public final void setVelocityEngine(VelocityEngine value)
VelocityEngine
of the instance.value
- The new VelocityEngine
of the instance or null
.getVelocityEngine()
public VelocityContext getVelocityContext() throws IOException
IOException
- if creating a new context instance fails.getTemplateParameters()
public final Map<String,Object> getTemplateParameters()
This accessor method returns a reference to the live map, not a snapshot. Therefore any modification you make
to the returned map will be present inside the object. This is why there is no set
method for the
template parameters property.
getVelocityContext()
public final URL getTemplateLocation()
null
.setTemplateLocation(java.net.URL)
public final void setTemplateLocation(URL value)
value
- The new location to search for templates in addition to searching the class path or null
.getTemplateLocation()
@Deprecated public final String getTemplateEncoding()
getDefaultTemplateEncoding()
. This method will be removed
in JOMC 2.0.setTemplateEncoding(java.lang.String)
@Deprecated public final void setTemplateEncoding(String value)
setDefaultTemplateEncoding(java.lang.String)
. This method
will be removed in JOMC 2.0.value
- The new encoding to use for reading templates or null
.getTemplateEncoding()
public final String getDefaultTemplateEncoding()
setDefaultTemplateEncoding(java.lang.String)
public final void setDefaultTemplateEncoding(String value)
value
- The new default encoding to use for reading templates or null
.getDefaultTemplateEncoding()
public final String getTemplateEncoding(String tp)
tp
- The template profile to get the template encoding of.tp
or the default template encoding
if no such encoding is defined.NullPointerException
- if tp
is null
.getDefaultTemplateEncoding()
public final String getInputEncoding()
setInputEncoding(java.lang.String)
public final void setInputEncoding(String value)
value
- The new encoding to use for reading files or null
.getInputEncoding()
public final String getOutputEncoding()
setOutputEncoding(java.lang.String)
public final void setOutputEncoding(String value)
value
- The encoding to use for writing files or null
.getOutputEncoding()
@Deprecated public static String getDefaultTemplateProfile()
static
modifier of this method and support to setup the default template profile using
a system property will be removed in version 2.0.The default template profile is the implicit parent profile of any template profile not specifying a parent template profile.
setDefaultTemplateProfile(java.lang.String)
@Deprecated public static void setDefaultTemplateProfile(String value)
static
modifier of this method will be removed in version 2.0.value
- The new default template profile or null
.getDefaultTemplateProfile()
public final String getTemplateProfile()
getDefaultTemplateProfile()
,
setTemplateProfile(java.lang.String)
public final void setTemplateProfile(String value)
value
- The new template profile of the instance or null
.getTemplateProfile()
public final String getParentTemplateProfile(String tp)
tp
- The template profile to get the parent template profile of.tp
; the default template
profile, if no such parent template profile is defined; null
, if tp
denotes the default template
profile.NullPointerException
- if tp
is null
.getDefaultTemplateProfile()
public final String getIndentation()
setIndentation(java.lang.String)
public final String getIndentation(int level)
level
- The indentation level to get an indentation string for.level
.IllegalArgumentException
- if level
is negative.getIndentation()
public final void setIndentation(String value)
value
- The new indentation string of the instance or null
.getIndentation()
public final String getLineSeparator()
setLineSeparator(java.lang.String)
public final void setLineSeparator(String value)
value
- The new line separator of the instance or null
.getLineSeparator()
public final Locale getLocale()
setLocale(java.util.Locale)
public final void setLocale(Locale value)
value
- The new locale of the instance or null
.getLocale()
public Template getVelocityTemplate(String templateName) throws FileNotFoundException, IOException
This method searches templates at the following locations recursively in the shown order stopping whenever a matching template is found.
org/jomc/tools/templates/profile
/language
/templateName
org/jomc/tools/templates/parent profile
/language
/templateName
org/jomc/tools/templates/profile
/templateName
org/jomc/tools/templates/parent profile
/language
/templateName
templateName
- The name of the template to get.templateName
.NullPointerException
- if templateName
is null
.FileNotFoundException
- if no such template is found.IOException
- if getting the template fails.getTemplateProfile()
,
getParentTemplateProfile(java.lang.String)
,
getLocale()
,
getTemplateEncoding(java.lang.String)
,
getVelocityEngine()
public void log(Level level, String message, Throwable throwable)
level
- The level of the event.message
- The message of the event or null
.throwable
- The throwable of the event or null
.NullPointerException
- if level
is null
.getListeners()
,
isLoggable(java.util.logging.Level)
Copyright © 2005-2012 The JOMC Project. All Rights Reserved.