org.eclipse.mofscript.runtime
Class TransformationProxy

java.lang.Object
  extended by org.eclipse.mofscript.runtime.TransformationProxy

public class TransformationProxy
extends java.lang.Object

Author:
jol

Constructor Summary
TransformationProxy(MOFScriptSpecification trSpec)
           
TransformationProxy(MOFScriptTransformation realTrans)
           
 
Method Summary
 void addImportedTransformation(java.lang.String importName, java.lang.String importUri, MOFScriptTransformation importedTransformation)
          Adds imported transformations to a collection
 java.lang.Object[] checkImportedRules(java.lang.String ruleName)
          Checks imported rules agains a rule name.
 java.util.Collection<TransformationRule> getAllImportedTransformationRules()
          Gets all teh imported transformation rules
 java.util.List getAllImportedVariables()
          Gets all the imported variables.
 java.util.Collection<TransformationRule> getAllTransformationRules(java.lang.String name)
          Gets all the transformation rules with the given "name"
 MOFScriptTransformation getClosestSuperWithRule(TransformationRule rule)
           
 TransformationRule getEntryPoint()
          Traverses the rules and checks if entrypoint
 MOFScriptTransformation getImportedTransformation(java.lang.String name)
          Gets an imported transfromation with name == parameter name
 java.util.Hashtable<java.lang.String,TransformationRule> getImportedTransformationRule(java.lang.String name)
          Gets all the importet transformation rules with a given name
 TransformationRule getImportedTransformationRule(java.lang.String name, java.lang.String possibleScoping, java.lang.String ownerTransformation)
          Gets a transformation rule according to the parameters
 java.lang.String getName()
           
 MOFScriptTransformation getTransformation()
           
 TransformationRule getTransformationRule(java.lang.String name)
          Gets the transformation rules based on "name"
 TransformationRule getTransformationRuleForType(FunctionCall f, java.lang.String name, java.lang.String ownerTransformation, java.lang.String possibleScope, java.lang.Object contextObject)
          Gets the transformation rule according to the parameters given
 java.util.Collection<TransformationRule> getTransformationRules()
          Gets the transformation rules
 MOFScriptSpecification getTransformationSpecification()
           
 java.lang.String getTransformationUriForRule(java.lang.String ruleName)
           
 boolean hasOtherRuleWithName(TransformationRule rule)
           
 boolean hasRuleWithName(java.lang.String ruleName)
          Checks if the rule cache has a rule with a given ruleName
 boolean isSuperTransformation(MOFScriptTransformation transformation)
          Checks whether a transformation is a super transformation
 boolean isSuperTransformation(java.lang.String trName)
           
 void setTransformationSpecification(MOFScriptSpecification trSpec)
          Sets the transformation specification
 boolean superHasRule(java.lang.String ruleName)
          Checks whether a super transfromation has a rule with a given name
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformationProxy

public TransformationProxy(MOFScriptTransformation realTrans)
Parameters:
realTrans -

TransformationProxy

public TransformationProxy(MOFScriptSpecification trSpec)
Parameters:
trSpec -
Method Detail

getTransformation

public MOFScriptTransformation getTransformation()
Returns:
the transformation

getTransformationSpecification

public MOFScriptSpecification getTransformationSpecification()
Returns:
the transformation specification

getName

public java.lang.String getName()
Returns:
the transformation's name

getEntryPoint

public TransformationRule getEntryPoint()
Traverses the rules and checks if entrypoint

Returns:
the transformation rule that is entry point

setTransformationSpecification

public void setTransformationSpecification(MOFScriptSpecification trSpec)
Sets the transformation specification

Parameters:
trSpec -

hasRuleWithName

public boolean hasRuleWithName(java.lang.String ruleName)
Checks if the rule cache has a rule with a given ruleName

Parameters:
ruleName -
Returns:
true if rule exists in cache

hasOtherRuleWithName

public boolean hasOtherRuleWithName(TransformationRule rule)
Parameters:
rule -
Returns:

getClosestSuperWithRule

public MOFScriptTransformation getClosestSuperWithRule(TransformationRule rule)
Parameters:
transformation -
rule -
Returns:
the first match of supertypes that contains the rule in question

getTransformationRules

public java.util.Collection<TransformationRule> getTransformationRules()
Gets the transformation rules

Returns:
collection of rules

getTransformationRule

public TransformationRule getTransformationRule(java.lang.String name)
Gets the transformation rules based on "name"

Parameters:
name -
Returns:
a transformation rule with matching name or null

getAllTransformationRules

public java.util.Collection<TransformationRule> getAllTransformationRules(java.lang.String name)
Gets all the transformation rules with the given "name"

Parameters:
name -
Returns:
a collection of rules or empty ArrayList

getAllImportedTransformationRules

public java.util.Collection<TransformationRule> getAllImportedTransformationRules()
Gets all teh imported transformation rules

Returns:
ArrayList of rules or empty

getImportedTransformationRule

public java.util.Hashtable<java.lang.String,TransformationRule> getImportedTransformationRule(java.lang.String name)
Gets all the importet transformation rules with a given name

Parameters:
name -
Returns:
ArrayList containing rules or empty

getImportedTransformationRule

public TransformationRule getImportedTransformationRule(java.lang.String name,
                                                        java.lang.String possibleScoping,
                                                        java.lang.String ownerTransformation)
Gets a transformation rule according to the parameters

Parameters:
name -
possibleScoping -
ownerTransformation -
Returns:
a transformation rule in accordance with the parameters provided

getImportedTransformation

public MOFScriptTransformation getImportedTransformation(java.lang.String name)
Gets an imported transfromation with name == parameter name

Parameters:
name -
Returns:
an imported transfromation with name == parameter name

getAllImportedVariables

public java.util.List getAllImportedVariables()
Gets all the imported variables. Removes duplicate vars.

Returns:

checkImportedRules

public java.lang.Object[] checkImportedRules(java.lang.String ruleName)
Checks imported rules agains a rule name. If the rule name matches, a value is returned containing the name of the rule and the rule itself

Parameters:
ruleName -
Returns:

getTransformationRuleForType

public TransformationRule getTransformationRuleForType(FunctionCall f,
                                                       java.lang.String name,
                                                       java.lang.String ownerTransformation,
                                                       java.lang.String possibleScope,
                                                       java.lang.Object contextObject)
Gets the transformation rule according to the parameters given

Parameters:
name -
ownerTransformation -
possibleScope -
contextObject -
Returns:

isSuperTransformation

public boolean isSuperTransformation(MOFScriptTransformation transformation)
Checks whether a transformation is a super transformation

Parameters:
transformation -
Returns:

isSuperTransformation

public boolean isSuperTransformation(java.lang.String trName)
Parameters:
trName -
Returns:

superHasRule

public boolean superHasRule(java.lang.String ruleName)
Checks whether a super transfromation has a rule with a given name

Parameters:
ruleName -
Returns:

addImportedTransformation

public void addImportedTransformation(java.lang.String importName,
                                      java.lang.String importUri,
                                      MOFScriptTransformation importedTransformation)
Adds imported transformations to a collection

Parameters:
importName -
importUri -
importedTransformation -

getTransformationUriForRule

public java.lang.String getTransformationUriForRule(java.lang.String ruleName)
Parameters:
ruleName -
Returns: