Groovy Documentation

org.codehaus.groovy.grails.commons
[Java] Interface GrailsClass

org.codehaus.groovy.grails.commons.GrailsClass
  org.codehaus.groovy.grails.plugins.support.aware.GrailsApplicationAware
All Superinterfaces:
GrailsApplicationAware

public interface GrailsClass
extends GrailsApplicationAware

Represents any class in a Grails application.

Authors:
Steven Devijver
Graeme Rocher
Since:
0.1


Method Summary
java.lang.Class getClazz()

Returns the actual clazz represented by the GrailsClass.

java.lang.String getFullName()

Returns the full name of the class in the application with the the trailing convention part and with the package name.

GrailsApplication getGrailsApplication()

The GrailsApplication that this class belongs to

java.lang.String getLogicalPropertyName()

Returns the logical name of the class as a property name.

groovy.lang.MetaClass getMetaClass()

@return The MetaClass for this Grails class

java.lang.String getName()

Returns the logical name of the class in the application without the trailing convention part if applicable and without the package name.

java.lang.String getNaturalName()

Returns the name of the property in natural terms (eg.

java.lang.String getPackageName()

Returns the package name of the class.

java.lang.String getPropertyName()

Returns the name of the class as a property name.

java.lang.Object getPropertyValue(java.lang.String name)

Gets the initial value of the given property on the class.

T getPropertyValue(java.lang.String name, java.lang.Class type)

Obtains a property value for the given name and type

org.springframework.beans.BeanWrapper getReference()

@deprecated

java.lang.Object getReferenceInstance()

@return Sample (reference) instance for this Grails class

java.lang.String getShortName()

Returns the short name of the class without package prefix.

boolean hasProperty(java.lang.String name)

Returns true if the class has the specified property.

boolean isAbstract()

Whether the class is abstract or not

java.lang.Object newInstance()

Creates a new instance of this class.

 
Methods inherited from interface GrailsApplicationAware
setGrailsApplication
 

Method Detail

getClazz

@SuppressWarnings("rawtypes")
public java.lang.Class getClazz()
Returns the actual clazz represented by the GrailsClass.
Returns:
the class


getFullName

public java.lang.String getFullName()
Returns the full name of the class in the application with the the trailing convention part and with the package name.
Returns:
the full name


getGrailsApplication

public GrailsApplication getGrailsApplication()
The GrailsApplication that this class belongs to
Returns:
The GrailsApplication instance


getLogicalPropertyName

public java.lang.String getLogicalPropertyName()
Returns the logical name of the class as a property name.
Returns:
The logical property name


getMetaClass

public groovy.lang.MetaClass getMetaClass()
Returns:
The MetaClass for this Grails class


getName

public java.lang.String getName()
Returns the logical name of the class in the application without the trailing convention part if applicable and without the package name.
Returns:
the logical name


getNaturalName

public java.lang.String getNaturalName()
Returns the name of the property in natural terms (eg. 'lastName' becomes 'Last Name')
Returns:
The natural property name.


getPackageName

public java.lang.String getPackageName()
Returns the package name of the class.
Returns:
the package name


getPropertyName

public java.lang.String getPropertyName()
Returns the name of the class as a property name.
Returns:
The property name representation


getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String name)
Gets the initial value of the given property on the class.
Parameters:
name - The name of the property
Returns:
The initial value


getPropertyValue

public T getPropertyValue(java.lang.String name, java.lang.Class type)
Obtains a property value for the given name and type
Parameters:
name - The name
type - The type
Returns:
The property value


getReference

@Deprecated
public org.springframework.beans.BeanWrapper getReference()
deprecated:
@return BeanWrapper for reference instance, deprecated


getReferenceInstance

public java.lang.Object getReferenceInstance()
Returns:
Sample (reference) instance for this Grails class


getShortName

public java.lang.String getShortName()
Returns the short name of the class without package prefix.
Returns:
The short name


hasProperty

public boolean hasProperty(java.lang.String name)
Returns true if the class has the specified property.
Parameters:
name - The name of the property
Returns:
True if it does


isAbstract

public boolean isAbstract()
Whether the class is abstract or not
Returns:
True if it is abstract


newInstance

public java.lang.Object newInstance()
Creates a new instance of this class. This method can be used as factory method in the Spring application context.
Returns:
a new instance of this class


 

Groovy Documentation