public class ModuleContext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ExprFactory |
_exprFactory |
protected MarshalFactory |
_marshalFactory |
Constructor and Description |
---|
ModuleContext(ModuleContext parent,
java.lang.ClassLoader loader)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
JavaClassDef |
addClass(java.lang.String name,
java.lang.Class<?> type,
java.lang.String extension,
java.lang.Class<?> javaClassDefClass) |
void |
addExtensionClass(java.lang.String ext,
java.lang.String clsName)
Adds a class to the extension's list of classes.
|
ModuleInfo |
addModule(java.lang.String name,
QuercusModule module)
Adds module info.
|
void |
addServiceClass(java.net.URL url)
Adds a URL for the context classes
|
void |
addServiceModule(java.net.URL url)
Adds a URL for the context module
|
protected JavaClassDef |
createDefaultJavaClassDef(java.lang.String className,
java.lang.Class type) |
protected JavaClassDef |
createDefaultJavaClassDef(java.lang.String className,
java.lang.Class type,
java.lang.String extension) |
StaticFunction |
createStaticFunction(QuercusModule module,
java.lang.reflect.Method method)
Creates a static function.
|
StringValue |
createString(java.lang.String s) |
StringValue |
createStringBuilder() |
QuercusModule |
findModule(java.lang.String name)
Returns the module with the given name.
|
java.util.HashMap<java.lang.String,ClassDef> |
getClassMap()
Returns the class maps.
|
ExprFactory |
getExprFactory() |
java.util.HashSet<java.lang.String> |
getExtensionClasses(java.lang.String ext)
Returns the list of the classes that are part of this extension.
|
JavaClassDef |
getJavaClassDefinition(java.lang.Class javaClass)
Returns a javaClassDef for the given class or null if there is not one.
|
JavaClassDef |
getJavaClassDefinition(java.lang.Class<?> type,
java.lang.String className)
Gets or creates a JavaClassDef for the given class name.
|
JavaClassDef |
getJavaClassDefinition(java.lang.String className)
Adds a java class
|
java.util.HashSet<java.lang.String> |
getLoadedExtensions()
Returns true if an extension is loaded.
|
MarshalFactory |
getMarshalFactory() |
java.util.ArrayList<ModuleInfo> |
getModules()
Returns the configured modules
|
QuercusClass |
getStdClass()
Returns the stdClass definition.
|
java.util.HashMap<java.lang.String,JavaClassDef> |
getWrapperMap()
Returns the class maps.
|
boolean |
hasServiceClass(java.net.URL url)
Tests if the URL has already been loaded for the context classes
|
void |
init() |
void |
introspectJavaClass(java.lang.String name,
java.lang.Class type,
java.lang.String extension,
java.lang.Class javaClassDefClass)
Introspects the module class for functions.
|
void |
introspectJavaImplClass(java.lang.String name,
java.lang.Class type,
java.lang.String extension)
Introspects the module class for functions.
|
boolean |
isExtensionLoaded(java.lang.String name)
Returns true if an extension is loaded.
|
boolean |
isUnicodeSemantics() |
static Value |
objectToValue(java.lang.Object obj) |
protected void |
setContextClassLoader(java.lang.ClassLoader loader)
Encapsulate setContextClassLoader for contexts where the
security manager is set.
|
void |
setUnicodeSemantics(boolean isUnicodeSemantics) |
java.lang.String |
toString() |
protected MarshalFactory _marshalFactory
protected ExprFactory _exprFactory
public ModuleContext(ModuleContext parent, java.lang.ClassLoader loader)
public boolean isUnicodeSemantics()
public void setUnicodeSemantics(boolean isUnicodeSemantics)
public StringValue createString(java.lang.String s)
public StringValue createStringBuilder()
public boolean hasServiceClass(java.net.URL url)
public void addServiceClass(java.net.URL url)
public void addServiceModule(java.net.URL url)
public ModuleInfo addModule(java.lang.String name, QuercusModule module) throws ConfigException
ConfigException
public JavaClassDef addClass(java.lang.String name, java.lang.Class<?> type, java.lang.String extension, java.lang.Class<?> javaClassDefClass) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.InstantiationException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.InstantiationException
public JavaClassDef getJavaClassDefinition(java.lang.Class<?> type, java.lang.String className)
public JavaClassDef getJavaClassDefinition(java.lang.String className)
public JavaClassDef getJavaClassDefinition(java.lang.Class javaClass)
protected JavaClassDef createDefaultJavaClassDef(java.lang.String className, java.lang.Class type)
protected JavaClassDef createDefaultJavaClassDef(java.lang.String className, java.lang.Class type, java.lang.String extension)
public MarshalFactory getMarshalFactory()
public ExprFactory getExprFactory()
public QuercusClass getStdClass()
public java.util.HashMap<java.lang.String,ClassDef> getClassMap()
public java.util.HashMap<java.lang.String,JavaClassDef> getWrapperMap()
public QuercusModule findModule(java.lang.String name)
public boolean isExtensionLoaded(java.lang.String name)
public java.util.HashSet<java.lang.String> getLoadedExtensions()
public void addExtensionClass(java.lang.String ext, java.lang.String clsName)
public java.util.HashSet<java.lang.String> getExtensionClasses(java.lang.String ext)
public StaticFunction createStaticFunction(QuercusModule module, java.lang.reflect.Method method)
public void init()
protected void setContextClassLoader(java.lang.ClassLoader loader)
public java.util.ArrayList<ModuleInfo> getModules()
public void introspectJavaClass(java.lang.String name, java.lang.Class type, java.lang.String extension, java.lang.Class javaClassDefClass) throws java.lang.IllegalAccessException, java.lang.InstantiationException, ConfigException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
name
- the php class nametype
- the class to introspect.extension
- the extension provided by the class, or nulljavaClassDefClass
- java.lang.IllegalAccessException
java.lang.InstantiationException
ConfigException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
public void introspectJavaImplClass(java.lang.String name, java.lang.Class type, java.lang.String extension) throws java.lang.IllegalAccessException, java.lang.InstantiationException, ConfigException
name
- the php class nametype
- the class to introspect.extension
- the extension provided by the class, or nulljava.lang.IllegalAccessException
java.lang.InstantiationException
ConfigException
public static Value objectToValue(java.lang.Object obj)
public java.lang.String toString()
toString
in class java.lang.Object