public class ReflectionParser
extends java.lang.Object
java.lang.Reflect
Method
or Constructor
object into an XML-based description.Modifier and Type | Field and Description |
---|---|
static java.util.ArrayList |
defaultMethods
List of methods from the base Service type that might be useful
|
static java.util.ArrayList |
objectMethods
List of methods from the base Object type
|
Constructor and Description |
---|
ReflectionParser()
Create a new instance of ReflectionParser.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
codeParameterName(java.lang.String methodName,
java.lang.String paramName)
Code the parameter name if required to make it unique.
|
static org.licas_xml.abs.Element |
constructorToShortXML(java.lang.reflect.Constructor constructor)
Create a shortened element to describe the constructor that is passed in.
|
static org.licas_xml.abs.Element |
constructorToXML(java.lang.reflect.Constructor constructor)
Create an element to describe the constructor that is passed in.
|
static java.lang.String |
decodeParameterName(java.lang.String methodName,
java.lang.String paramName)
Decode the parameter name if required.
|
static java.lang.String |
formatClassName(java.lang.String theClassName)
Convert the class names into a formatted version for displaying.
|
static java.lang.reflect.Constructor |
getConstructor(java.lang.reflect.Constructor[] constructors,
java.lang.Class[] paramTypes)
Check all constructors to see if any match the input parameters or super classes
of the input psarameters.
|
static java.lang.reflect.Constructor[] |
getConstructors(java.lang.Class theClass)
Retrieve the constructors for the specified class.
|
static java.lang.reflect.Method[] |
getMethods(java.lang.Class theClass)
Retrieve a list of all public methods in the class.
|
static org.licas_xml.abs.Element |
methodToShortXML(java.lang.reflect.Method method)
Create a shortened element to describe the method that is passed in.
|
static org.licas_xml.abs.Element |
methodToXML(java.lang.reflect.Method method)
Create an element to describe the method that is passed in.
|
static org.licas_xml.abs.Element |
methodToXML(java.lang.reflect.Method method,
java.util.ArrayList paramNames)
Create an element to describe the method that is passed in.
|
static java.lang.String |
unformatClassName(java.lang.String serviceClass)
Convert the formatted classname back to its binary form.
|
static MethodInfo |
xmlToMethod(org.licas_xml.abs.Element methodXml)
Create a MethodInfo object from the XML description.
|
public static final java.util.ArrayList objectMethods
public static final java.util.ArrayList defaultMethods
public ReflectionParser()
public static java.lang.reflect.Constructor[] getConstructors(java.lang.Class theClass)
theClass
- the class instance.public static java.lang.reflect.Method[] getMethods(java.lang.Class theClass)
theClass
- the class instance.public static java.lang.reflect.Constructor getConstructor(java.lang.reflect.Constructor[] constructors, java.lang.Class[] paramTypes)
constructors
- a list of constructors.paramTypes
- the parameter type classes.public static org.licas_xml.abs.Element constructorToXML(java.lang.reflect.Constructor constructor)
constructor
- the constructor description from a reflectionpublic static org.licas_xml.abs.Element constructorToShortXML(java.lang.reflect.Constructor constructor)
constructor
- the constructor description from a reflectionpublic static org.licas_xml.abs.Element methodToXML(java.lang.reflect.Method method)
method
- the method description from a reflection process.public static org.licas_xml.abs.Element methodToXML(java.lang.reflect.Method method, java.util.ArrayList paramNames)
method
- the method description from a reflection process.paramNames
- a list of names to assign to each method parameter. They get added
in the order that they are specified. If null then the name field does not get added.public static org.licas_xml.abs.Element methodToShortXML(java.lang.reflect.Method method)
method
- the method description from a reflectionpublic static MethodInfo xmlToMethod(org.licas_xml.abs.Element methodXml) throws java.lang.Exception
methodXml
- the method description.java.lang.Exception
- any error.public static java.lang.String formatClassName(java.lang.String theClassName)
theClassName
- the fully qualified class name with path details.public static java.lang.String unformatClassName(java.lang.String serviceClass)
serviceClass
- the current service class specification.public static java.lang.String codeParameterName(java.lang.String methodName, java.lang.String paramName)
methodName
- the method name.paramName
- the parameter name.public static java.lang.String decodeParameterName(java.lang.String methodName, java.lang.String paramName)
methodName
- the method name.paramName
- the parameter name.