public enum ContextFactory extends Enum<ContextFactory>
Context
's from passed in data. Currently any valid JSON or XML string can be
converted to a Context.
TODO: Enhance to suppert Nashorn ECMA JSON objects, do what client code does not have to do JSON.stringify() on those???
Created by QuijadaJ on 5/3/2017.Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
static Context |
obtainContext(Object pData)
Factory method which will attempt to return a
Context by inspecting the passed in pData. |
static MutableContext |
obtainMutableContext(Object pData)
Sames as
obtainContext(Object) , but returns ab object of type MutableContext . |
static ContextFactory |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ContextFactory[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ContextFactory INSTANCE
public static ContextFactory[] values()
for (ContextFactory c : ContextFactory.values()) System.out.println(c);
public static ContextFactory valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static Context obtainContext(Object pData) throws IllegalArgumentException
Context
by inspecting the passed in pData. The
pData passed in must be in a format that will be recognized, otherwise IllegalArgumentException
exception gets thrown. At this time only JSON format is supported, and the JSON is built by relying
on Google JSON API. Plans are to add support for XML format using a similar,
already existing 3rd party XML API.pData
- - The data from which a Context
will be constructed.Context
object.IllegalArgumentException
- - TODOpublic static MutableContext obtainMutableContext(Object pData) throws IllegalArgumentException
obtainContext(Object)
, but returns ab object of type MutableContext
.pData
- - pDataIllegalArgumentException
- - TODOCopyright © 2019. All rights reserved.