public abstract class AbstractGriffonClass extends java.lang.Object implements GriffonClass
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<java.lang.String> |
eventsCache |
protected org.slf4j.Logger |
log |
STANDARD_PROPERTIES
Constructor and Description |
---|
AbstractGriffonClass(GriffonApplication application,
java.lang.Class<?> type,
java.lang.String artifactType,
java.lang.String trailingName) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
GriffonApplication |
getApplication() |
java.lang.String |
getArtifactType()
Returns the artifact type represented by the GriffonClass
|
java.lang.Class<?> |
getClazz()
Returns the actual class represented by the GriffonClass
|
java.lang.String[] |
getEventNames() |
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.
|
java.lang.String |
getLogicalPropertyName()
Returns the logical name of the class as a property name
|
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[] |
getPropertiesWithFields()
Returns an array of property names that are backed by a filed with a matching
name.
|
java.lang.String |
getPropertyName()
Returns the name of the class as a property name
|
protected java.lang.Object |
getPropertyOrStaticPropertyOrFieldValue(java.lang.String name,
java.lang.Class<?> type)
Looks for a property of the reference instance with a given name and type.
|
java.lang.Class<?> |
getPropertyType(java.lang.String name) |
java.lang.Object |
getPropertyValue(java.lang.String name)
Gets the initial value of the given property on the class.
|
<T> T |
getPropertyValue(java.lang.String name,
java.lang.Class<T> type)
Obtains a property value for the given name and type.
|
java.lang.String |
getShortName()
Returns the short name of the class without package prefix
|
int |
hashCode() |
boolean |
hasProperty(java.lang.String name)
Returns true if the class has the specified property.
|
boolean |
isReadableProperty(java.lang.String name) |
void |
resetCaches() |
java.lang.String |
toString() |
protected final java.util.Set<java.lang.String> eventsCache
protected final org.slf4j.Logger log
public AbstractGriffonClass(@Nonnull GriffonApplication application, @Nonnull java.lang.Class<?> type, @Nonnull java.lang.String artifactType, @Nonnull java.lang.String trailingName)
@Nonnull public GriffonApplication getApplication()
getApplication
in interface GriffonClass
@Nullable public java.lang.Object getPropertyValue(@Nonnull java.lang.String name)
GriffonClass
getPropertyValue
in interface GriffonClass
name
- The name of the propertypublic boolean hasProperty(@Nonnull java.lang.String name)
GriffonClass
hasProperty
in interface GriffonClass
name
- The name of the property@Nonnull public java.lang.String getName()
GriffonClass
getName
in interface GriffonClass
@Nonnull public java.lang.String getShortName()
GriffonClass
getShortName
in interface GriffonClass
@Nonnull public java.lang.String getFullName()
GriffonClass
getFullName
in interface GriffonClass
@Nonnull public java.lang.String getPropertyName()
GriffonClass
getPropertyName
in interface GriffonClass
@Nonnull public java.lang.String getLogicalPropertyName()
GriffonClass
getLogicalPropertyName
in interface GriffonClass
@Nonnull public java.lang.String getNaturalName()
GriffonClass
getNaturalName
in interface GriffonClass
@Nonnull public java.lang.String getPackageName()
GriffonClass
getPackageName
in interface GriffonClass
@Nonnull public java.lang.Class<?> getClazz()
GriffonClass
getClazz
in interface GriffonClass
@Nonnull public java.lang.String getArtifactType()
GriffonClass
getArtifactType
in interface GriffonClass
@Nullable public <T> T getPropertyValue(@Nonnull java.lang.String name, @Nonnull java.lang.Class<T> type)
GriffonClass
getPropertyValue
in interface GriffonClass
name
- The nametype
- The typepublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void resetCaches()
@Nonnull public java.lang.String[] getEventNames()
public java.lang.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 java.lang.Class<?> getPropertyType(java.lang.String name)
public boolean isReadableProperty(java.lang.String name)
protected java.lang.Object getPropertyOrStaticPropertyOrFieldValue(@Nonnull java.lang.String name, @Nonnull java.lang.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: