thinkmap.xmlconfig
Class Assembler
java.lang.Object
thinkmap.xmlconfig.Assembler
public class Assembler
- extends Object
|
Method Summary |
XObject |
accessConstant(Class<?> reference,
String name)
|
void |
addPostConfigureListener(thinkmap.xmlconfig.Assembler.ConfigurationListener l)
|
void |
addPreConfigureListener(thinkmap.xmlconfig.Assembler.ConfigurationListener l)
|
void |
assignId(String id,
XObject code)
|
void |
callReturn(XObject value)
|
XObject |
cast(XObject x,
Class<?> asType)
|
XObject |
constructNew(Class<?> clazz)
|
XObject |
constructNew(Class<?> clazz,
Class<?>[] argTypes,
XObject[] args)
|
XObject |
convertToType(Namespace ns,
String args,
Class<?> c,
Class<?> parentType,
ConfigElement currentElement)
|
XObject |
createBoolean(boolean x)
|
XObject |
createByte(byte x)
|
XObject |
createChar(char x)
|
XObject |
createDouble(double x)
|
XObject |
createFloat(float x)
|
XObject |
createInt(int x)
|
XObject |
createLong(long x)
|
XObject |
createNull()
|
protected XObject |
createObject(Class<?> type,
Object value)
|
XObject |
createShort(short x)
|
XObject |
createString(String value)
|
XObject |
createURL(String url)
|
XObject |
createURL(URL url)
|
XObject |
getArgument(int i)
|
int |
getArgumentCount()
|
XMLConfigBuilder |
getBuilder()
|
protected XObject |
getConfiguration()
|
protected static Object |
getConstant(String name,
Class<?> c,
Class<?> expectedType)
|
protected static Field |
getField(String name,
Class<?> c)
|
Assembler.Mode |
getMode()
|
XObject |
getReferenceById(String id)
|
XObject |
initArray(Class<?> arrayType,
XObject[] components)
|
XObject |
invokeMethod(XObject parent,
Method method,
XObject... args)
|
XObject |
invokeMethod(XObject parent,
String name,
Class<?>[] argTypes,
XObject[] args)
|
XObject |
invokeStatic(Class<?> parent,
String name,
Class<?>[] argTypes,
XObject[] args)
|
protected void |
notifyPostConfigure(XObject object,
ConfigElement currentElement)
|
protected void |
notifyPreConfigure(XObject object,
ConfigElement currentElement)
|
protected void |
setQuiet(boolean b)
|
protected Class<?> |
toBigType(Class<?> c)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
postConfigureListeners
protected List<thinkmap.xmlconfig.Assembler.ConfigurationListener> postConfigureListeners
preConfigureListeners
protected List<thinkmap.xmlconfig.Assembler.ConfigurationListener> preConfigureListeners
ZERO_ARGS
public static final Class<?>[] ZERO_ARGS
quiet
protected boolean quiet
arguments
protected XObject[] arguments
primativeFalse
protected XObject primativeFalse
primativeTrue
protected XObject primativeTrue
NULL
protected XObject NULL
builder
protected XMLConfigBuilder builder
Assembler
public Assembler(XMLConfigBuilder builder,
Class<?>[] argTypes,
Object[] argValues)
getMode
public Assembler.Mode getMode()
getArgumentCount
public int getArgumentCount()
getBuilder
public XMLConfigBuilder getBuilder()
createBoolean
public XObject createBoolean(boolean x)
createURL
public XObject createURL(URL url)
createURL
public XObject createURL(String url)
throws MalformedURLException
- Throws:
MalformedURLException
createInt
public XObject createInt(int x)
createShort
public XObject createShort(short x)
createLong
public XObject createLong(long x)
createByte
public XObject createByte(byte x)
createChar
public XObject createChar(char x)
createFloat
public XObject createFloat(float x)
createDouble
public XObject createDouble(double x)
accessConstant
public XObject accessConstant(Class<?> reference,
String name)
throws IllegalArgumentException,
IllegalAccessException
- Throws:
IllegalArgumentException
IllegalAccessException
getArgument
public XObject getArgument(int i)
cast
public XObject cast(XObject x,
Class<?> asType)
callReturn
public void callReturn(XObject value)
constructNew
public XObject constructNew(Class<?> clazz,
Class<?>[] argTypes,
XObject[] args)
throws Exception
- Throws:
Exception
constructNew
public XObject constructNew(Class<?> clazz)
throws InstantiationException,
IllegalAccessException
- Throws:
InstantiationException
IllegalAccessException
invokeMethod
public XObject invokeMethod(XObject parent,
Method method,
XObject... args)
throws Exception
- Throws:
Exception
invokeMethod
public XObject invokeMethod(XObject parent,
String name,
Class<?>[] argTypes,
XObject[] args)
throws Exception
- Throws:
Exception
invokeStatic
public XObject invokeStatic(Class<?> parent,
String name,
Class<?>[] argTypes,
XObject[] args)
throws Exception
- Throws:
Exception
createString
public XObject createString(String value)
createNull
public XObject createNull()
initArray
public XObject initArray(Class<?> arrayType,
XObject[] components)
assignId
public void assignId(String id,
XObject code)
throws Exception
- Throws:
Exception
getConfiguration
protected XObject getConfiguration()
getReferenceById
public XObject getReferenceById(String id)
throws Exception
- Throws:
Exception
convertToType
public XObject convertToType(Namespace ns,
String args,
Class<?> c,
Class<?> parentType,
ConfigElement currentElement)
throws Exception
- Throws:
Exception
toBigType
protected Class<?> toBigType(Class<?> c)
getConstant
protected static Object getConstant(String name,
Class<?> c,
Class<?> expectedType)
getField
protected static Field getField(String name,
Class<?> c)
createObject
protected XObject createObject(Class<?> type,
Object value)
notifyPreConfigure
protected void notifyPreConfigure(XObject object,
ConfigElement currentElement)
throws Exception
- Throws:
Exception
notifyPostConfigure
protected void notifyPostConfigure(XObject object,
ConfigElement currentElement)
throws Exception
- Throws:
Exception
addPostConfigureListener
public void addPostConfigureListener(thinkmap.xmlconfig.Assembler.ConfigurationListener l)
addPreConfigureListener
public void addPreConfigureListener(thinkmap.xmlconfig.Assembler.ConfigurationListener l)
setQuiet
protected void setQuiet(boolean b)
Copyright © 2013 Thinkmap, Inc. All Rights Reserved.