public final class JCType extends JCHandler
JCType
class represents a reflected CLR Type. It implements
methods and accessor to interact with a CLR Type.
To instantiate a valid JCType
use a valid instance of
JCOBridge
with JCOBridge.GetType(java.lang.String)
.
Some examples on its use are on https://github.com/masesgroup/JCOReflector
Modifier and Type | Method and Description |
---|---|
Object |
Get(String propertyName)
Retrieve a static property from the reflected CLR Type.
|
Object |
GetField(String field)
Retrieve a static field from the reflected CLR Type.
|
Object |
GetOnType(String propertyName)
Retrieve a property from the reflected CLR Type.
|
int |
hashCode()
This method is used to get the CLR hashCode.
|
Object |
Invoke(String method,
Object... params)
Invokes a static method on the reflected CLR Type with optional parameters.
|
Object |
InvokeOnType(String method,
Object... params)
Invokes a method on the reflected CLR Type with optional parameters.
|
Object |
NewObject(Object... params)
Create a new object using the reflected CLR Type and optional parameters for
constructor.
|
JCType |
Set(String propertyName,
Object value)
Sets a static property on the reflected CLR Type.
|
JCType |
SetField(String field,
Object value)
Sets a static field on the reflected CLR Type.
|
String |
toString()
This method is used to get the equivalent CLR ToString.
|
getReference
public int hashCode()
public String toString()
public Object NewObject(Object... params) throws JCNativeException
params
- Optional parameters to pass to the constructorJCObject
for all other typesJCNativeException
- In case of error in the CLR contextpublic Object Invoke(String method, Object... params) throws JCNativeException
method
- The static method to be invoked on the CLR Typeparams
- Optional parameters to pass to the methodJCObject
for all other typesJCNativeException
- In case of error in the CLR contextpublic Object Get(String propertyName) throws JCNativeException
propertyName
- The static property to be get from the CLR TypeJCObject
for all other typesJCNativeException
- In case of error in the CLR contextpublic Object GetField(String field) throws JCNativeException
field
- The static field to be get from the CLR TypeJCObject
for all other typesJCNativeException
- In case of error in the CLR contextpublic JCType Set(String propertyName, Object value) throws JCNativeException
propertyName
- The static property to be get from the CLR Typevalue
- The value to be setJCType
for chaining purposeJCNativeException
- In case of error in the CLR contextpublic JCType SetField(String field, Object value) throws JCNativeException
field
- The static field to be get from the CLR Typevalue
- The value to be setJCType
for chaining purposeJCNativeException
- In case of error in the CLR contextpublic Object InvokeOnType(String method, Object... params) throws JCNativeException
method
- The method to be invoked on the CLR Typeparams
- Optional parameters to pass to the methodJCObject
for all other typesJCNativeException
- In case of error in the CLR contextpublic Object GetOnType(String propertyName) throws JCNativeException
propertyName
- The property to be get from the CLR TypeJCObject
for all other typesJCNativeException
- In case of error in the CLR context