org.apache.beehive.controls.runtime.generator
Class AptControlInterface

Object
  extended by AptType
      extended by AptControlInterface
All Implemented Interfaces:
Generator

public class AptControlInterface
extends AptType
implements Generator

The AptControlInterface provides validation and metadata management for a ControlInterface or ControlExtension class during APT processing. It is also used to model the interface to contextual services, since they parallel the conventions of control interfaces.


Constructor Summary
AptControlInterface(Declaration decl, TwoPhaseAnnotationProcessor ap)
          Constructs a new AptControlInterface instance where interface information is derived from an APT interface declaration
 
Method Summary
 boolean addsBoundPropertySupport()
          Returns true if this interface is the first interface in the inheritance hierarchy to declare support for bound properties.
 boolean addsConstrainedPropertySupport()
          Returns true if this interface is the first interface in the inheritance hierarchy to declare support for constrained properties.
 void check()
          Runs control-specific checker class (if specified)
 List<GeneratorOutput> getCheckOutput(Filer filer)
          Returns the information necessary to generate a ControlBean from this AptControlInterface
 AptEventSet getEventSet(String name)
          Returns the AptEventSet with the specified name
 int getEventSetCount()
          Returns the total number of operations for this control interface
 Collection<AptEventSet> getEventSets()
          Returns the list of AptEventSet declared directly by this AptControlInterface
 ClassLoader getExternalClassLoader()
          Returns a classloader that can be used to load external classes
 FeatureInfo getFeatureInfo()
          Returns the FeatureInfo attributes for this control interface
 String[] getGeneratedTypes()
          Returns the list of fully qualified class names for types that are derived from this Generator
 List<GeneratorOutput> getGenerateOutput(Filer filer)
          Returns the information necessary to generate a packaging information from this AptControlInterface.
 Collection<AptControlInterfaceProperty> getInterfaceProperties()
          Returns the list of properties defined by getter and setter methods in this control interface.
 int getLocalEventSetCount()
          Returns the number of event sets declared in this control interface.
 HashMap<String,String> getManifestAttributes()
          Returns the array of ManifestAttributes associated with the AptControlInterface
 AptControlInterface getMostDerivedInterface()
          Returns the most-derived interface in the inheritance chain that is annotated with @ControlInterface.
 int getOperationCount()
          Returns the total number of operations for this control interface
 Collection<AptOperation> getOperations()
          Returns the list of ControlOperations declared directly by this AptControlInterface
 int getPropertyCount()
          Returns the total number of properties for this control interface
 Collection<AptPropertySet> getPropertySets()
          Returns the list of PropertySets declared directly by this AptControlInterface
 AptControlInterface getSuperClass()
          Returns the super interface for this interface
 InterfaceType getSuperType()
          Returns the parent control interface or extension type from which the control interface is derived (or null, if it is at the root of the interface hierarchy)
 Version getVersion()
          Returns the Version annotation, if any.
 VersionRequired getVersionRequired()
          Returns the VersionRequired annotation, if any.
 boolean hasBoundProperties()
          Returns true if the interface has any bound properties associated with it.
 boolean hasConstrainedProperties()
          Returns true if any properties declared directly by this control interface are constrained properties.
 boolean isExtension()
          Returns true if this interface is a ControlExtension (jcx) interface, false otherwise.
 
Methods inherited from class AptType
getClassName, getFormalClassName, getFormalShortName, getFormalTypeParameterNames, getFormalTypeParameters, getPackage, getShortName, getTypeDeclaration, isPrivateMethod, setDeclaration
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AptControlInterface

public AptControlInterface(Declaration decl,
                           TwoPhaseAnnotationProcessor ap)
Constructs a new AptControlInterface instance where interface information is derived from an APT interface declaration

Parameters:
decl - the annotated Declaration
ap - the top-level annotation processor
Method Detail

getSuperType

public InterfaceType getSuperType()
Returns the parent control interface or extension type from which the control interface is derived (or null, if it is at the root of the interface hierarchy)


getSuperClass

public AptControlInterface getSuperClass()
Returns the super interface for this interface


getOperations

public Collection<AptOperation> getOperations()
Returns the list of ControlOperations declared directly by this AptControlInterface


getOperationCount

public int getOperationCount()
Returns the total number of operations for this control interface


getPropertySets

public Collection<AptPropertySet> getPropertySets()
Returns the list of PropertySets declared directly by this AptControlInterface


getPropertyCount

public int getPropertyCount()
Returns the total number of properties for this control interface


getInterfaceProperties

public Collection<AptControlInterfaceProperty> getInterfaceProperties()
Returns the list of properties defined by getter and setter methods in this control interface.


hasBoundProperties

public boolean hasBoundProperties()
Returns true if the interface has any bound properties associated with it.


addsBoundPropertySupport

public boolean addsBoundPropertySupport()
Returns true if this interface is the first interface in the inheritance hierarchy to declare support for bound properties. This is used to declared PropertyChangeListener registration methods for the bean once (and only once).


hasConstrainedProperties

public boolean hasConstrainedProperties()
Returns true if any properties declared directly by this control interface are constrained properties. This will not reflect the attributes of properties declared on an interface from which this interface derives.


addsConstrainedPropertySupport

public boolean addsConstrainedPropertySupport()
Returns true if this interface is the first interface in the inheritance hierarchy to declare support for constrained properties. This is used to declared VetoableChangeListener registration methods for the bean once (and only once).


getEventSets

public Collection<AptEventSet> getEventSets()
Returns the list of AptEventSet declared directly by this AptControlInterface


getEventSetCount

public int getEventSetCount()
Returns the total number of operations for this control interface


getLocalEventSetCount

public int getLocalEventSetCount()
Returns the number of event sets declared in this control interface. Does not include eventset's declared in super class(es).


getEventSet

public AptEventSet getEventSet(String name)
Returns the AptEventSet with the specified name


getFeatureInfo

public FeatureInfo getFeatureInfo()
Returns the FeatureInfo attributes for this control interface


getGeneratedTypes

public String[] getGeneratedTypes()
Returns the list of fully qualified class names for types that are derived from this Generator

Specified by:
getGeneratedTypes in interface Generator

getVersion

public Version getVersion()
Returns the Version annotation, if any.


getVersionRequired

public VersionRequired getVersionRequired()
Returns the VersionRequired annotation, if any.


getCheckOutput

public List<GeneratorOutput> getCheckOutput(Filer filer)
                                     throws IOException
Returns the information necessary to generate a ControlBean from this AptControlInterface

Specified by:
getCheckOutput in interface Generator
Throws:
IOException

getGenerateOutput

public List<GeneratorOutput> getGenerateOutput(Filer filer)
                                        throws IOException
Returns the information necessary to generate a packaging information from this AptControlInterface. Since this information is not needed during type validation, it can be delated until the generate phase.

Specified by:
getGenerateOutput in interface Generator
Throws:
IOException

isExtension

public boolean isExtension()
Returns true if this interface is a ControlExtension (jcx) interface, false otherwise.


getMostDerivedInterface

public AptControlInterface getMostDerivedInterface()
Returns the most-derived interface in the inheritance chain that is annotated with @ControlInterface. It represents the point in the inheritance chain where @ControlInterface becomes @ControlExtension (i.e., anything interface derived from the 'most-derived interface' is annotated with @ControlExtension). May return null if the inheritance chain is malformed.


getExternalClassLoader

public ClassLoader getExternalClassLoader()
Returns a classloader that can be used to load external classes


getManifestAttributes

public HashMap<String,String> getManifestAttributes()
Returns the array of ManifestAttributes associated with the AptControlInterface


check

public void check()
Runs control-specific checker class (if specified)