com.inline.feature.example
Class JavaFieldFeature

java.lang.Object
  |
  +--com.inline.feature.common.AbstractResourceListener
        |
        +--com.inline.feature.common.AbstractFeature
              |
              +--com.inline.feature.example.JavaFieldFeature

public class JavaFieldFeature
extends AbstractFeature


Field Summary
static java.lang.String ACCESS_TYPE
           
protected  JavaMemberAccessType accessType
           
protected  com.inline.vide.inflect.ClassDescriptor classDescriptor
           
protected  ResourceAdapter classDescriptorAdapter
           
protected  boolean editable
           
static java.lang.String FIELD_NAME
          Property names
static java.lang.String FIELD_TYPE
           
protected  com.inline.vide.inflect.FieldDescriptor fieldDescriptor
           
protected  java.lang.String fieldName
           
protected  java.lang.String fieldType
           
protected  boolean signatureChanged
           
static java.lang.String STATIC
           
protected  boolean staticFlag
           
static java.lang.String TYPE
           
 
Fields inherited from class com.inline.feature.common.AbstractResourceListener
active, featureModel, parent, resourceAdapters, resourceSetAdapters, revalidate
 
Constructor Summary
JavaFieldFeature(Feature parent, java.lang.String signature)
           
 
Method Summary
protected  void applyChanges()
          Override to apply changes made to the feature's properties permanent.
 boolean canChange(java.lang.String property)
          By default this method returns true.
 boolean canDelete()
          Returns true if the feature can be removed.
static java.lang.String constructSignature(Feature parent, java.lang.String fieldName)
           
protected  void delete()
          Override to remove feature from persistent resources.
 JavaMemberAccessType getAccessType()
           
 java.lang.String getFieldName()
           
 java.lang.String getFieldType()
           
 java.lang.String getType()
          Returns the feature type.
protected  void insert()
          Override to make the feature persistent.
 boolean isStatic()
           
 void parseSignature(java.lang.String signature)
          Override this to extract some of the feature properties from the signature.
protected  void propertyChanged(java.lang.String property, java.lang.Object oldValue, java.lang.Object newValue)
          Override this method if you want to be notified when a property of this feature changes (that means actually changes its value).
protected  void refreshProperties()
          Override to parse resources.
protected  void refreshProperty(java.lang.String property)
          The overloaded implementation of this method should refresh the value of the specified managed property.
protected  void registerDependencies()
          Override to register all resource adapters this feature set depends upon.
 void setAccessType(JavaMemberAccessType type)
           
protected  void setEditable(boolean flag)
           
 void setFieldName(java.lang.String fieldName)
           
 void setFieldType(java.lang.String type)
           
 void setStatic(boolean flag)
           
protected  boolean validateChanges(com.sun.java.util.collections.List list)
          Override to produce validations for the feature.
 
Methods inherited from class com.inline.feature.common.AbstractFeature
activate, addManagedProperty, addMessages, addPropertyChangeListener, commit, firePropertyChange, firePropertyChange, getActions, getChildren, getChildSetActions, getDisplayProperties, getDisplayType, getMessages, getPrimitiveActions, getSignature, getURL, invalidate, isMarkedForDeletion, isModified, isModified, isNew, markForDeletion, refresh, refresh, release, removePropertyChangeListener, toString, toStringVerbose, validateChanges
 
Methods inherited from class com.inline.feature.common.AbstractResourceListener
getFeatureModel, getParent, passivate, propertyChange, registerResourceAdapter, registerResourceAdapter, registerResourceSetAdapter, registerResourceSetAdapter, resourceAdded, resourceChanged, resourceRemoved, unregisterResourceAdapter, unregisterResourceSetAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final java.lang.String TYPE

FIELD_NAME

public static final java.lang.String FIELD_NAME
Property names

FIELD_TYPE

public static final java.lang.String FIELD_TYPE

ACCESS_TYPE

public static final java.lang.String ACCESS_TYPE

STATIC

public static final java.lang.String STATIC

classDescriptorAdapter

protected ResourceAdapter classDescriptorAdapter

classDescriptor

protected com.inline.vide.inflect.ClassDescriptor classDescriptor

fieldDescriptor

protected com.inline.vide.inflect.FieldDescriptor fieldDescriptor

fieldName

protected java.lang.String fieldName

signatureChanged

protected boolean signatureChanged

editable

protected boolean editable

fieldType

protected java.lang.String fieldType

accessType

protected JavaMemberAccessType accessType

staticFlag

protected boolean staticFlag
Constructor Detail

JavaFieldFeature

public JavaFieldFeature(Feature parent,
                        java.lang.String signature)
Method Detail

registerDependencies

protected void registerDependencies()
Description copied from class: AbstractResourceListener
Override to register all resource adapters this feature set depends upon. Call registerResourceAdapter(reference) for each resource adapter and registerResourceSetAdapter(type, qualifier) for each resource set adapter. AbstractResourceListener will make the feature an observer of events from those adapters as needed.
Overrides:
registerDependencies in class AbstractResourceListener

getType

public java.lang.String getType()
Description copied from interface: Feature
Returns the feature type.

The recommended type declaration syntax is:

      class MyFeature ... {
          public static final String TYPE = "foo-bar-myfeature";
          public String getType() { return TYPE; }
          ...
      }
  

constructSignature

public static java.lang.String constructSignature(Feature parent,
                                                  java.lang.String fieldName)

parseSignature

public void parseSignature(java.lang.String signature)
Description copied from class: AbstractFeature
Override this to extract some of the feature properties from the signature. If the signature is not carrying any of those properties, there is no need to override this method.
Overrides:
parseSignature in class AbstractFeature

getFieldName

public java.lang.String getFieldName()

setFieldName

public void setFieldName(java.lang.String fieldName)

getFieldType

public java.lang.String getFieldType()

setFieldType

public void setFieldType(java.lang.String type)

getAccessType

public JavaMemberAccessType getAccessType()

setAccessType

public void setAccessType(JavaMemberAccessType type)

isStatic

public boolean isStatic()

setStatic

public void setStatic(boolean flag)

setEditable

protected void setEditable(boolean flag)

canChange

public boolean canChange(java.lang.String property)
Description copied from class: AbstractFeature
By default this method returns true. Override it to provide logic that determines whether or not a particular property is editable.
Overrides:
canChange in class AbstractFeature

canDelete

public boolean canDelete()
Description copied from class: AbstractFeature
Returns true if the feature can be removed. The default implementation simply returns true.
Overrides:
canDelete in class AbstractFeature

refreshProperties

protected void refreshProperties()
Description copied from class: AbstractFeature
Override to parse resources. This method is invoked by refresh(). The registerDependencies method is called prior to refreshProperties, therefore the registered resource adapters and resource set adapters can be used by this method. parseSignature() is also called before refreshProperties.

The implementation of refreshProperties should call setBar() methods to set the feature properties. This way observers of the feature will be informed whenever conseqent executions of refresh produce different property values.

The method should re-acquire resources from resource adapters. Note that a resource adapter may return a different instance of resource when invoked from consequent refreshProperties() calls.

Overrides:
refreshProperties in class AbstractFeature

refreshProperty

protected void refreshProperty(java.lang.String property)
Description copied from class: AbstractFeature
The overloaded implementation of this method should refresh the value of the specified managed property. Note that even if all properties of the feature are managed, refreshProperties() will be called anyway prior to any refreshProperty(property) calls.
Overrides:
refreshProperty in class AbstractFeature

insert

protected void insert()
Description copied from class: AbstractFeature
Override to make the feature persistent. You can assume that registerDependencies was called before this method is invoked, therefore it can use registered resource adapters and resource set adapters.
Overrides:
insert in class AbstractFeature

delete

protected void delete()
Description copied from class: AbstractFeature
Override to remove feature from persistent resources. You should explicitly call refresh from this method if needed. The only assumption that can be made by this method is that the feature has a signature and that the feature's properties have not been modified since the last refresh() (if any).
Overrides:
delete in class AbstractFeature

applyChanges

protected void applyChanges()
Description copied from class: AbstractFeature
Override to apply changes made to the feature's properties permanent. Only called if the feature has been modified since last refresh. You can assume that refresh was in fact called before applyChanges() and all cached references to resources are safe to use.
Overrides:
applyChanges in class AbstractFeature

propertyChanged

protected void propertyChanged(java.lang.String property,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
Description copied from class: AbstractFeature
Override this method if you want to be notified when a property of this feature changes (that means actually changes its value). This method is not called during the resource parsing.
Overrides:
propertyChanged in class AbstractFeature

validateChanges

protected boolean validateChanges(com.sun.java.util.collections.List list)
Description copied from class: AbstractFeature
Override to produce validations for the feature. This method is invoked during the commit process. If it returns false, commit is canceled. If the method discovers any problem with the feature's properties that would prevent it from being successfully committed, it should put a description of the problem in the form of an object of type FeatureMessage into the supplied list and return false. Otherwise it should return true.
Overrides:
validateChanges in class AbstractFeature