|
||||||||||
| 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
| Field Summary | |
|---|---|
(package private) static org.apache.commons.logging.Log |
LOG
|
| Constructor Summary | |
|---|---|
AbstractGrailsClass(Class clazz,
String trailingName)
Contructor to be 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 name)
|
Object |
getPropertyValue(String name)
Gets the initial value of the given property on the class |
Object |
getPropertyValue(String name,
Class 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 name)
|
BeanWrapper |
getReference()
Deprecated. |
Object |
getReferenceInstance()
|
String |
getShortName()
Returns the short name of the class without package prefix |
boolean |
hasMetaMethod(String name)
|
boolean |
hasMetaMethod(String name,
Object[] args)
|
boolean |
hasMetaProperty(String name)
|
boolean |
hasProperty(String name)
Returns true if the class has the specified property |
boolean |
isReadableProperty(String name)
|
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 |
| Field Detail |
|---|
static final org.apache.commons.logging.Log LOG
| Constructor Detail |
|---|
public AbstractGrailsClass(Class clazz,
String trailingName)
Contructor to be used by all child classes to create a new instance and get the name right.
clazz - the Grails classtrailingName - the trailing part of the name for this class type| Method Detail |
|---|
public String getShortName()
GrailsClassReturns the short name of the class without package prefix
getShortName in interface GrailsClasspublic Class getClazz()
GrailsClassReturns the actual clazz represented by the GrailsClass
getClazz in interface GrailsClasspublic Object newInstance()
GrailsClassCreates a new instance of this class.
This method can be used as factory method in the Spring application context.
newInstance in interface GrailsClasspublic String getName()
GrailsClassReturns the logical name of the class in the application without the trailing convention part if applicable and without the package name.
getName in interface GrailsClasspublic String getNaturalName()
GrailsClassReturns the name of the property in natural terms (eg. 'lastName' becomes 'Last Name')
getNaturalName in interface GrailsClasspublic String getFullName()
GrailsClassReturns the full name of the class in the application with the the trailing convention part and with the package name.
getFullName in interface GrailsClasspublic String getPropertyName()
GrailsClassReturns the name of the class as a property name
getPropertyName in interface GrailsClasspublic String getLogicalPropertyName()
GrailsClassReturns the logical name of the class as a property name
getLogicalPropertyName in interface GrailsClasspublic String getPackageName()
GrailsClassReturns the package name of the class.
getPackageName in interface GrailsClasspublic Object getReferenceInstance()
getReferenceInstance in interface GrailsClasspublic PropertyDescriptor[] getPropertyDescriptors()
public Class getPropertyType(String name)
public boolean isReadableProperty(String name)
public boolean hasMetaMethod(String name)
public boolean hasMetaMethod(String name,
Object[] args)
public boolean hasMetaProperty(String name)
public BeanWrapper getReference()
The reference instance is used to get configured property values.
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 Object getPropertyValue(String name,
Class type)
getPropertyValue in interface GrailsClassname - type -
public Object getPropertyValueObject(String name)
public Object getPropertyValue(String name)
GrailsClassGets the initial value of the given property on the class
getPropertyValue in interface GrailsClassname - The name of the property
public boolean hasProperty(String name)
GrailsClassReturns true if the class has the specified property
hasProperty in interface GrailsClassname - The name of the property
public groovy.lang.MetaClass getMetaClass()
getMetaClass in interface GrailsClasspublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||