|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.databinding.tool.reflection.ModelClass
public abstract class ModelClass
Constructor Summary | |
---|---|
ModelClass()
|
Method Summary | |
---|---|
abstract ModelClass |
box()
When this is a primitive type, such as boolean, this will return the boxed value, such as Boolean. |
abstract ModelClass |
erasure()
Returns this class type without any generic type arguments. |
boolean |
extendsViewStub()
|
Callable |
findGetterOrField(java.lang.String name,
boolean staticOnly)
Returns the getter method or field that the name refers to. |
ModelMethod |
findInstanceGetter(java.lang.String name)
|
java.util.List<ModelMethod> |
findMethods(java.lang.String name,
boolean staticOnly)
Finds public methods that matches the given name exactly. |
java.util.List<ModelMethod> |
getAbstractMethods()
Returns a list of all abstract methods in the type. |
java.lang.String |
getCanonicalName()
|
abstract ModelClass |
getComponentType()
For arrays, lists, and maps, this returns the contained value. |
protected abstract ModelField[] |
getDeclaredFields()
|
protected abstract ModelMethod[] |
getDeclaredMethods()
|
abstract java.lang.String |
getJniDescription()
Returns the JNI description of the method which can be used to lookup it in SDK. |
ModelMethod |
getMethod(java.lang.String name,
java.util.List<ModelClass> args,
boolean staticOnly)
Returns the public method with the name name with the parameters that
best match args. |
ModelMethod[] |
getMethods(java.lang.String name,
int numParameters)
Returns all public instance methods with the given name and number of parameters. |
ModelMethod[] |
getMethods(java.lang.String name,
java.util.List<ModelClass> args,
boolean staticOnly)
Returns an array containing all public methods on the type represented by this ModelClass with the name name and can take the passed-in types as arguments. |
int |
getMinApi()
Since when this class is available. |
java.lang.String |
getSimpleName()
|
abstract ModelClass |
getSuperclass()
If this represents a class, the super class that it extends is returned. |
abstract java.util.List<ModelClass> |
getTypeArguments()
|
abstract boolean |
isArray()
|
abstract boolean |
isAssignableFrom(ModelClass that)
Returns whether or not the type associated with that can be assigned to
the type associated with this ModelClass. |
abstract boolean |
isBoolean()
|
abstract boolean |
isByte()
|
abstract boolean |
isChar()
|
abstract boolean |
isDouble()
|
abstract boolean |
isFloat()
|
abstract boolean |
isGeneric()
|
boolean |
isIncomplete()
|
abstract boolean |
isInt()
|
abstract boolean |
isInterface()
|
boolean |
isList()
|
abstract boolean |
isLong()
|
boolean |
isMap()
|
abstract boolean |
isNullable()
|
boolean |
isObject()
|
boolean |
isObservable()
|
boolean |
isObservableField()
|
abstract boolean |
isPrimitive()
|
abstract boolean |
isShort()
|
boolean |
isString()
|
abstract boolean |
isTypeVar()
|
boolean |
isViewDataBinding()
|
abstract boolean |
isVoid()
|
abstract boolean |
isWildcard()
|
abstract java.lang.String |
toJavaCode()
|
abstract ModelClass |
unbox()
When this is a boxed type, such as Integer, this will return the unboxed value, such as int. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModelClass()
Method Detail |
---|
public abstract java.lang.String toJavaCode()
public abstract boolean isArray()
public abstract ModelClass getComponentType()
public boolean isList()
public boolean isMap()
public boolean isString()
public abstract boolean isNullable()
public abstract boolean isPrimitive()
public abstract boolean isBoolean()
public abstract boolean isChar()
public abstract boolean isByte()
public abstract boolean isShort()
public abstract boolean isInt()
public abstract boolean isLong()
public abstract boolean isFloat()
public abstract boolean isDouble()
public abstract boolean isGeneric()
public abstract java.util.List<ModelClass> getTypeArguments()
public abstract boolean isTypeVar()
public abstract boolean isWildcard()
public boolean isObject()
public abstract boolean isInterface()
public boolean isViewDataBinding()
public boolean extendsViewStub()
public boolean isObservable()
public boolean isObservableField()
public abstract boolean isVoid()
public abstract ModelClass unbox()
public abstract ModelClass box()
public abstract boolean isAssignableFrom(ModelClass that)
that
can be assigned to
the type associated with this ModelClass. If this and that only require boxing or unboxing
then true is returned.
that
- the ModelClass to compare.
that
requires only boxing or if that
is an
implementation of or subclass of this
.public ModelMethod[] getMethods(java.lang.String name, java.util.List<ModelClass> args, boolean staticOnly)
name
and can take the passed-in types as arguments. This will
also work if the arguments match VarArgs parameter.
name
- The name of the method to find.args
- The types that the method should accept.staticOnly
- Whether only static methods should be returned or both instance methods
and static methods are valid.
name
and taking
args
parameters.public ModelMethod[] getMethods(java.lang.String name, int numParameters)
name
- The name of the method to find.numParameters
- The number of parameters that the method should take
public ModelMethod getMethod(java.lang.String name, java.util.List<ModelClass> args, boolean staticOnly)
name
with the parameters that
best match args. staticOnly
governs whether a static or instance method
will be returned. If no matching method was found, null is returned.
name
- The method name to findargs
- The arguments that the method should acceptstaticOnly
- true if the returned method must be static or false if it does not
matter.public abstract ModelClass getSuperclass()
null
is returned if this is not a class or interface, such as an int, or
if it is java.lang.Object or an interface that does not extend any other type.
public java.lang.String getCanonicalName()
public java.lang.String getSimpleName()
public abstract ModelClass erasure()
public int getMinApi()
public abstract java.lang.String getJniDescription()
TypeUtil
public java.util.List<ModelMethod> getAbstractMethods()
public Callable findGetterOrField(java.lang.String name, boolean staticOnly)
name
- The name of the field or the body of the method name -- can be name(),
getName(), or isName().staticOnly
- Whether this should look for static methods and fields or instance
versions
public ModelMethod findInstanceGetter(java.lang.String name)
public java.util.List<ModelMethod> findMethods(java.lang.String name, boolean staticOnly)
public boolean isIncomplete()
protected abstract ModelField[] getDeclaredFields()
protected abstract ModelMethod[] getDeclaredMethods()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |