implementations
Class ConcernJInheritance

java.lang.Object
  |
  +--implementations.JavaImplementationGenerator
        |
        +--implementations.ConcernJImplementationGenerator
              |
              +--implementations.ConcernJInheritance
All Implemented Interfaces:
ImplementationGeneratorI

public class ConcernJInheritance
extends ConcernJImplementationGenerator

Implementation generator plugin class for implementing an Inheritance composite in ConcernJ.

Version:
0.1.06, 7 Maart 2003
Author:
Dennis Wagelaar

Constructor Summary
ConcernJInheritance()
          Constructs a ConcernJInheritance
 
Method Summary
 void apply(ImplementationGenerator implementation, GenerateImplementationVisitor generateImpl)
          Applies the implementation generator.
protected  void applyPerChild()
          Applies the implementation generator for each Child concept.
protected  void applyToChild(Concept child, java.util.Collection parents)
          Applies the implementation generator to a Child concept.
protected  void applyToRealm(UniqueRealm realm)
          Applies the implementation generator to a UniqueRealm.
protected  void checkRoles()
          Checks the composite roles for existence.
protected  java.util.Collection createFiltermodulesDecl(java.lang.String target)
          Creates the filtermodules declarations for use in the superimposition block.
POST: result ::= Collection<String>
protected  java.lang.String createFilterRule(Concept concept)
          Creates a filter rule from the given concept.
protected  java.util.Collection createFilterRules(java.util.Collection parents)
          Creates a collection of filter rules given a collection of class concepts.
PRE: parents ::= Collection<Concept>
POST: result ::= Collection<String>
protected  java.util.Collection createInputFilters(java.util.Collection parents)
          Creates the input filters for inheritance.
PRE: parents ::= Collection<Concept>
POST: result ::= Collection<String>
protected  java.lang.String createInternal(Concept concept)
          Creates an internal declaration from the given concept.
protected  java.util.Collection createInternals(java.util.Collection classes)
          Creates a collection of internal declarations given a collection of class concepts.
PRE: classes ::= Collection<Concept>
POST: result ::= Collection<String>
protected  java.lang.String createSelector(java.util.Collection concepts)
          Creates a selector declaration for use in the superimposition block.
PRE: concepts ::= Collection<Concept>
protected  java.util.Collection createSelectors(java.util.Collection concepts)
          Creates a collection of selector declarations for use in the superimposition block.
PRE: concepts ::= Collection<Concept>
POST: result ::= Collection<String>
protected  CompositeRole getChildRole()
          Retrieves the child role of the composite.
protected  CompositeRole getParentRole()
          Retrieves the parent role of the composite.
protected  java.lang.String getSelectorName()
          Returns the selector name based on the composite.
 
Methods inherited from class implementations.ConcernJImplementationGenerator
createFiltermodule, getFiltermoduleName, getRealmImplementation, insertFiltermodule, insertMethodOverrideID, insertParameters, insertReturnType, insertSuperimposition, makeFilterDecl
 
Methods inherited from class implementations.JavaImplementationGenerator
createClause, createMethod, getClasses, getComposite, getConceptsFor, getCurrentImplementation, getCurrentImplementation, getImplGen, getInstanceName, getInterfaces, getModel, getPrimitives, getVisitor, insertExtends, insertImplements, insertImports, insertMethod, insertPrimitiveImplementation, insertPrimitiveImplementations, insertVariables, isClass, isInterface, isMethod, isPrimitive, isStatic, lcfirst, setCurrentImplementation, setCurrentImplementation, ucfirst
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcernJInheritance

public ConcernJInheritance()
Constructs a ConcernJInheritance
Method Detail

getParentRole

protected CompositeRole getParentRole()
Retrieves the parent role of the composite.
Returns:
The parent CompositeRole.

getChildRole

protected CompositeRole getChildRole()
Retrieves the child role of the composite.
Returns:
The child CompositeRole.

checkRoles

protected void checkRoles()
                   throws CoComposeException
Checks the composite roles for existence.
Throws:
CoComposeException - if a required role does not exist.

createInternal

protected java.lang.String createInternal(Concept concept)
Creates an internal declaration from the given concept.
Parameters:
concept - The concept to create the internal declaration for.
Returns:
The internal declaration.

createFilterRule

protected java.lang.String createFilterRule(Concept concept)
Creates a filter rule from the given concept.
Parameters:
concept - The concept to create the filter rule for.
Returns:
The filter rule.

createInternals

protected java.util.Collection createInternals(java.util.Collection classes)
                                        throws CoComposeException
Creates a collection of internal declarations given a collection of class concepts.
PRE: classes ::= Collection<Concept>
POST: result ::= Collection<String>
Parameters:
classes - The collection of class concepts.
Returns:
The collection of internal declarations.
Throws:
CoComposeException -  

createFilterRules

protected java.util.Collection createFilterRules(java.util.Collection parents)
                                          throws CoComposeException
Creates a collection of filter rules given a collection of class concepts.
PRE: parents ::= Collection<Concept>
POST: result ::= Collection<String>
Parameters:
parents - The collection of parent class concepts.
Returns:
The collection of filter rules.
Throws:
CoComposeException -  

createInputFilters

protected java.util.Collection createInputFilters(java.util.Collection parents)
                                           throws CoComposeException
Creates the input filters for inheritance.
PRE: parents ::= Collection<Concept>
POST: result ::= Collection<String>
Parameters:
parents - The parent class concepts.
Returns:
The collection of input filter declarations
Throws:
CoComposeException -  

createFiltermodulesDecl

protected java.util.Collection createFiltermodulesDecl(java.lang.String target)
Creates the filtermodules declarations for use in the superimposition block.
POST: result ::= Collection<String>
Parameters:
target - The target identifier of the superimposition.
Returns:
The collection of filtermodule declarations.

getSelectorName

protected java.lang.String getSelectorName()
Returns the selector name based on the composite.
Returns:
The selector name.

createSelector

protected java.lang.String createSelector(java.util.Collection concepts)
Creates a selector declaration for use in the superimposition block.
PRE: concepts ::= Collection<Concept>
Parameters:
concepts - The collection of concepts to put in the selector.
Returns:
The selector declaration.

createSelectors

protected java.util.Collection createSelectors(java.util.Collection concepts)
Creates a collection of selector declarations for use in the superimposition block.
PRE: concepts ::= Collection<Concept>
POST: result ::= Collection<String>
Parameters:
concepts - The collection of concepts to put in the selector.
Returns:
The collection of selector declarations.

applyPerChild

protected void applyPerChild()
                      throws CoComposeException
Applies the implementation generator for each Child concept.
Throws:
CoComposeException - if generating implementation failed.

applyToChild

protected void applyToChild(Concept child,
                            java.util.Collection parents)
                     throws CoComposeException
Applies the implementation generator to a Child concept.
Parameters:
child - The concept to apply the role part for.
parents - The set of parent concepts.
Throws:
CoComposeException - if generating implementation failed.

applyToRealm

protected void applyToRealm(UniqueRealm realm)
                     throws CoComposeException
Applies the implementation generator to a UniqueRealm.
Parameters:
realm - The unique realm.
Throws:
CoComposeException - if generating implementation failed.

apply

public void apply(ImplementationGenerator implementation,
                  GenerateImplementationVisitor generateImpl)
           throws CoComposeException
Applies the implementation generator.
Overrides:
apply in class JavaImplementationGenerator
Parameters:
implementation - The implementation generator to apply.
generateImpl - The language specific code generation operation visitor.
Throws:
CoComposeException - if generating implementation failed.