public abstract class AbstractGriffonClass extends Object implements GriffonClass
Modifier and Type | Field and Description |
---|---|
protected Set<String> |
eventsCache |
protected Logger |
log |
STANDARD_PROPERTIES
Constructor and Description |
---|
AbstractGriffonClass(GriffonApplication application,
Class<?> type,
String artifactType,
String trailingName) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
GriffonApplication |
getApplication() |
String |
getArtifactType()
Returns the artifact type represented by the GriffonClass
|
Class<?> |
getClazz()
Returns the actual class represented by the GriffonClass
|
String[] |
getEventNames() |
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
|
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.
|
String[] |
getPropertiesWithFields()
Returns an array of property names that are backed by a filed with a matching
name.
|
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.
|
<T> T |
getPropertyValue(String name,
Class<T> type)
Obtains a property value for the given name and type.
|
String |
getShortName()
Returns the short name of the class without package prefix
|
int |
hashCode() |
boolean |
hasProperty(String name)
Returns true if the class has the specified property.
|
boolean |
isReadableProperty(String name) |
void |
resetCaches() |
String |
toString() |
@Nonnull public GriffonApplication getApplication()
getApplication
in interface GriffonClass
@Nullable public Object getPropertyValue(@Nonnull String name)
GriffonClass
getPropertyValue
in interface GriffonClass
name
- The name of the propertypublic boolean hasProperty(@Nonnull String name)
GriffonClass
hasProperty
in interface GriffonClass
name
- The name of the property@Nonnull public String getName()
GriffonClass
getName
in interface GriffonClass
@Nonnull public String getShortName()
GriffonClass
getShortName
in interface GriffonClass
@Nonnull public String getFullName()
GriffonClass
getFullName
in interface GriffonClass
@Nonnull public String getPropertyName()
GriffonClass
getPropertyName
in interface GriffonClass
@Nonnull public String getLogicalPropertyName()
GriffonClass
getLogicalPropertyName
in interface GriffonClass
@Nonnull public String getNaturalName()
GriffonClass
getNaturalName
in interface GriffonClass
@Nonnull public String getPackageName()
GriffonClass
getPackageName
in interface GriffonClass
@Nonnull public Class<?> getClazz()
GriffonClass
getClazz
in interface GriffonClass
@Nonnull public String getArtifactType()
GriffonClass
getArtifactType
in interface GriffonClass
@Nullable public <T> T getPropertyValue(@Nonnull String name, @Nonnull Class<T> type)
GriffonClass
getPropertyValue
in interface GriffonClass
name
- The nametype
- The typepublic void resetCaches()
public String[] getPropertiesWithFields()
Fields must be private and non-static. Names will be returned in the order they are declared in the class, starting from the deepest class in the class hierarchy up to the topmost superclass != null
public boolean isReadableProperty(String name)
protected Object getPropertyOrStaticPropertyOrFieldValue(@Nonnull String name, @Nonnull 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: