public class LiteralFactory extends Object
Constructor and Description |
---|
LiteralFactory() |
Modifier and Type | Method and Description |
---|---|
static LiteralValue<?> |
getLiteral(Context context,
Object o)
Returns a literal value (specialization of Statement) representing the
given object in the given context.
|
static LiteralValue<?> |
getLiteral(Object o)
Returns a literal value (specialization of Statement) representing the
given object in the given context.
|
static LiteralValue<?> |
isLiteral(Object o)
Returns a literal value (specialization of Statement) representing the
given object in the given context, or null if the value is not
literalizable.
|
public static LiteralValue<?> getLiteral(Object o)
o
- The object to create a literal value for.NotLiteralizableException
- if o
cannot be literalizedpublic static LiteralValue<?> getLiteral(Context context, Object o)
context
- The context the literal value will be code-generated in. Contexts
can specify additional literalizable types. See Context.addLiteralizableClass(Class)
.o
- The object to create a literal value for.NotLiteralizableException
- if o
cannot be literalizedpublic static LiteralValue<?> isLiteral(Object o)
o
- The object to create a literal value for.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.