|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.grails.commons.AbstractGrailsClass
public abstract class AbstractGrailsClass
Abstract base class for Grails types that provides common functionality for evaluating conventions within classes.
Constructor Summary | |
---|---|
AbstractGrailsClass(Class<?> clazz,
String trailingName)
Used by all child classes to create a new instance and get the name right. |
Method Summary | ||
---|---|---|
Class<?> |
getClazz()
Returns the actual clazz represented by the GrailsClass. |
|
String |
getFullName()
Returns the full name of the class in the application with the the trailing convention part and with the package name. |
|
String |
getLogicalPropertyName()
Returns the logical name of the class as a property name. |
|
groovy.lang.MetaClass |
getMetaClass()
|
|
String |
getName()
Returns the logical name of the class in the application without the trailing convention part if applicable and without the package name. |
|
String |
getNaturalName()
Returns the name of the property in natural terms (eg. |
|
String |
getPackageName()
Returns the package name of the class. |
|
PropertyDescriptor[] |
getPropertyDescriptors()
|
|
String |
getPropertyName()
Returns the name of the class as a property name. |
|
protected Object |
getPropertyOrStaticPropertyOrFieldValue(String name,
Class<?> type)
Looks for a property of the reference instance with a given name and type. |
|
Class<?> |
getPropertyType(String typeName)
|
|
Object |
getPropertyValue(String propName)
Gets the initial value of the given property on the class. |
|
|
getPropertyValue(String propName,
Class<T> type)
Get the value of the named property, with support for static properties in both Java and Groovy classes (which as of Groovy JSR 1.0 RC 01 only have getters in the metaClass) |
|
Object |
getPropertyValueObject(String propertyNAme)
|
|
BeanWrapper |
getReference()
Deprecated. |
|
Object |
getReferenceInstance()
|
|
String |
getShortName()
Returns the short name of the class without package prefix. |
|
|
getStaticPropertyValue(String propName,
Class<T> type)
Get the value of the named static property. |
|
boolean |
hasMetaMethod(String methodName)
|
|
boolean |
hasMetaMethod(String methodName,
Object[] args)
|
|
boolean |
hasMetaProperty(String propName)
|
|
boolean |
hasProperty(String propName)
Returns true if the class has the specified property. |
|
boolean |
isReadableProperty(String propName)
|
|
Object |
newInstance()
Creates a new instance of this class. |
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractGrailsClass(Class<?> clazz, String trailingName)
clazz
- the Grails classtrailingName
- the trailing part of the name for this class typeMethod Detail |
---|
public String getShortName()
GrailsClass
getShortName
in interface GrailsClass
public Class<?> getClazz()
GrailsClass
getClazz
in interface GrailsClass
public Object newInstance()
GrailsClass
newInstance
in interface GrailsClass
public String getName()
GrailsClass
getName
in interface GrailsClass
public String getNaturalName()
GrailsClass
getNaturalName
in interface GrailsClass
public String getFullName()
GrailsClass
getFullName
in interface GrailsClass
public String getPropertyName()
GrailsClass
getPropertyName
in interface GrailsClass
public String getLogicalPropertyName()
GrailsClass
getLogicalPropertyName
in interface GrailsClass
public String getPackageName()
GrailsClass
getPackageName
in interface GrailsClass
public Object getReferenceInstance()
getReferenceInstance
in interface GrailsClass
public PropertyDescriptor[] getPropertyDescriptors()
public Class<?> getPropertyType(String typeName)
public boolean isReadableProperty(String propName)
public boolean hasMetaMethod(String methodName)
public boolean hasMetaMethod(String methodName, Object[] args)
public boolean hasMetaProperty(String propName)
@Deprecated public BeanWrapper getReference()
getReference
in interface GrailsClass
protected Object getPropertyOrStaticPropertyOrFieldValue(String name, Class<?> type)
Looks for a property of the reference instance with a given name and type.
If found its value is returned. We follow the Java bean conventions with augmentation for groovy support and static fields/properties. We will therefore match, in this order:
public <T> T getStaticPropertyValue(String propName, Class<T> type)
propName
- type
-
public <T> T getPropertyValue(String propName, Class<T> type)
getPropertyValue
in interface GrailsClass
propName
- type
-
public Object getPropertyValueObject(String propertyNAme)
public Object getPropertyValue(String propName)
GrailsClass
getPropertyValue
in interface GrailsClass
propName
- The name of the property
public boolean hasProperty(String propName)
GrailsClass
hasProperty
in interface GrailsClass
propName
- The name of the property
public groovy.lang.MetaClass getMetaClass()
getMetaClass
in interface GrailsClass
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |