| Modifier and Type | Field and Description |
|---|---|
static Charset |
UTF8_CHARSET |
| Constructor and Description |
|---|
ModelGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearCaches()
Clears the model and Javascript code caches
|
static ModelBean |
createModel(Class<?> clazz)
Instrospects the provided class and creates a
ModelBean instance. |
static ModelBean |
createModel(Class<?> clazz,
IncludeValidation includeValidation)
Instrospects the provided class and creates a
ModelBean instance. |
static ModelBean |
createModel(Class<?> clazz,
OutputConfig outputConfig) |
static String |
generateJavascript(Class<?> clazz,
OutputConfig outputConfig) |
static String |
generateJavascript(Class<?> clazz,
OutputFormat format,
boolean debug)
Instrospects the provided class, creates a model object (JS code) and returns it.
|
static String |
generateJavascript(Class<?> clazz,
OutputFormat format,
IncludeValidation includeValidation,
boolean debug)
Instrospects the provided class, creates a model object (JS code) and returns it.
|
static String |
generateJavascript(ModelBean model,
OutputConfig outputConfig) |
static String |
generateJavascript(ModelBean model,
OutputFormat format,
boolean debug)
Creates JS code based on the provided
ModelBean in the specified
OutputFormat. |
static void |
writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Class<?> clazz,
OutputConfig outputConfig) |
static void |
writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Class<?> clazz,
OutputFormat format)
Instrospects the provided class, creates a model object (JS code) and writes it
into the response.
|
static void |
writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Class<?> clazz,
OutputFormat format,
boolean debug)
Instrospects the provided class, creates a model object (JS code) and writes it
into the response.
|
static void |
writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Class<?> clazz,
OutputFormat format,
IncludeValidation includeValidation,
boolean debug)
Instrospects the provided class, creates a model object (JS code) and writes it
into the response.
|
static void |
writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ModelBean model,
OutputConfig outputConfig) |
static void |
writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ModelBean model,
OutputFormat format)
Creates a model object (JS code) based on the provided
ModelBean and writes
it into the response. |
static void |
writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ModelBean model,
OutputFormat format,
boolean debug)
Creates a model object (JS code) based on the provided ModelBean and writes it into
the response.
|
public static final Charset UTF8_CHARSET
public static void writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Class<?> clazz,
OutputFormat format)
throws IOException
request - the http servlet requestresponse - the http servlet responseclazz - class that the generator should introspectformat - specifies which code (ExtJS or Touch) the generator should create.IOExceptionwriteModel(HttpServletRequest, HttpServletResponse, Class, OutputFormat,
boolean)public static void writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Class<?> clazz,
OutputFormat format,
boolean debug)
throws IOException
request - the http servlet requestresponse - the http servlet responseclazz - class that the generator should introspectformat - specifies which code (ExtJS or Touch) the generator should createdebug - if true the generator creates the output in pretty format, false the
output is compressedIOExceptionpublic static void writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Class<?> clazz,
OutputFormat format,
IncludeValidation includeValidation,
boolean debug)
throws IOException
request - the http servlet requestresponse - the http servlet responseclazz - class that the generator should introspectformat - specifies which code (ExtJS or Touch) the generator should createincludeValidation - specifies if any validation configurations should be added
to the model codedebug - if true the generator creates the output in pretty format, false the
output is compressedIOExceptionpublic static void writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Class<?> clazz,
OutputConfig outputConfig)
throws IOException
IOExceptionpublic static void writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ModelBean model,
OutputFormat format)
throws IOException
ModelBean and writes
it into the response. Creates compressed JS code.request - the http servlet requestresponse - the http servlet responsemodel - ModelBean describing the model to be generatedformat - specifies which code (ExtJS or Touch) the generator should create.IOExceptionpublic static void writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ModelBean model,
OutputFormat format,
boolean debug)
throws IOException
request - the http servlet requestresponse - the http servlet responsemodel - ModelBean describing the model to be generatedformat - specifies which code (ExtJS or Touch) the generator should create.debug - if true the generator creates the output in pretty format, false the
output is compressedIOExceptionpublic static ModelBean createModel(Class<?> clazz)
ModelBean instance. A program
could customize this and call
generateJavascript(ModelBean, OutputFormat, boolean) or
writeModel(HttpServletRequest, HttpServletResponse, ModelBean, OutputFormat)
to create the JS code. Calling this method does not add any validation
configuration.clazz - the model will be created based on this class.ModelBean that describes the provided class and can
be used for Javascript generation.public static ModelBean createModel(Class<?> clazz, IncludeValidation includeValidation)
ModelBean instance. A program
could customize this and call
generateJavascript(ModelBean, OutputFormat, boolean) or
writeModel(HttpServletRequest, HttpServletResponse, ModelBean, OutputFormat)
to create the JS code. Models are being cached. A second call with the same
parameters will return the model from the cache.clazz - the model will be created based on this class.includeValidation - specifies what validation configuration should be addedModelBean that describes the provided class and can
be used for Javascript generation.public static String generateJavascript(Class<?> clazz, OutputFormat format, boolean debug)
clazz - class that the generator should introspectformat - specifies which code (ExtJS or Touch) the generator should createdebug - if true the generator creates the output in pretty format, false the
output is compressedpublic static String generateJavascript(Class<?> clazz, OutputConfig outputConfig)
public static String generateJavascript(Class<?> clazz, OutputFormat format, IncludeValidation includeValidation, boolean debug)
clazz - class that the generator should introspectformat - specifies which code (ExtJS or Touch) the generator should createincludeValidation - specifies what validation configuration should be added to
the mode codedebug - if true the generator creates the output in pretty format, false the
output is compressedpublic static String generateJavascript(ModelBean model, OutputFormat format, boolean debug)
ModelBean in the specified
OutputFormat. Code can be generated in pretty or compressed format. The
generated code is cached unless debug is true. A second call to this method with
the same model name and format will return the code from the cache.model - generate code based on this ModelBeanformat - specifies which code (ExtJS or Touch) the generator should createdebug - if true the generator creates the output in pretty format, false the
output is compressedpublic static void writeModel(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
ModelBean model,
OutputConfig outputConfig)
throws IOException
IOExceptionpublic static ModelBean createModel(Class<?> clazz, OutputConfig outputConfig)
public static String generateJavascript(ModelBean model, OutputConfig outputConfig)
public static void clearCaches()
Copyright © 2013–2015. All rights reserved.