| Modifier and Type | Method and Description |
|---|---|
static void |
applyBindings(Object model)
Apply bindings of a model class.
|
static <Model> Model |
bind(Model model,
net.java.html.BrwsrCtx context)
Binds given model to another context.
|
static <M> M |
fromRaw(net.java.html.BrwsrCtx ctx,
Class<M> model,
Object jsonObject)
Converts an existing, raw, JSON object into a
model class. |
static boolean |
isModel(Class<?> clazz)
Finds out whether given class is a model class - e.g. has been
generated by
@Model annotation. |
static <M> M |
parse(net.java.html.BrwsrCtx c,
Class<M> model,
InputStream is)
Generic method to parse content of a model class from a stream.
|
static Object |
toRaw(Object model)
Converts an existing
model into its associated, raw
JSON object. |
public static boolean isModel(Class<?> clazz)
@Model annotation.clazz - the class to testclazz was generated by Model annotationpublic static <Model> Model bind(Model model,
net.java.html.BrwsrCtx context)
Model - class defined by Model annotationmodel - instance of a model defined by Model annotationcontext - context to which the model should be boundcontextIllegalArgumentException - in case the instance is not generated by model interfacepublic static <M> M parse(net.java.html.BrwsrCtx c,
Class<M> model,
InputStream is)
throws IOException
c - context of the technology to use for readingmodel - the model class generated by Model annotationis - input stream with dataIOExceptionpublic static <M> M fromRaw(net.java.html.BrwsrCtx ctx,
Class<M> model,
Object jsonObject)
model class.M - the type of the model classctx - context of the technology to use for convertingmodel - the model classjsonObject - original instance of the JSON objectpublic static Object toRaw(Object model)
model into its associated, raw
JSON object. The object may, but does not have to, be the same instance
as the model object.model - the model object (not null)IllegalArgumentException - if the model is
not instance of a class
generated by model annotation processor.public static void applyBindings(Object model)
model - instance of a classIllegalArgumentException - if the model is not
instance of a class generated by model annotation
processor.Copyright © 2014 NetBeans. All Rights Reserved.