org.ow2.jonas.generators.genic
Class VcCMRField

java.lang.Object
  extended by org.ow2.jonas.generators.genic.VcCMRField

public class VcCMRField
extends Object

This class is used in the velocity context. It represents a CMR field.

Author:
S.Chassande-Barrioz : Initial developer, Helene Joanin

Constructor Summary
VcCMRField(EjbRelationshipRoleDesc rsr)
          It builds a cmr field descriptor usable in velocity context.
 
Method Summary
 EntityCmp2Desc getElement()
           
 String getGenClassName()
           
 String getHelperClassName()
          CoherenceHelper class is used to manage coherence in relations.
 String getHelperFQClassName()
          CoherenceHelper class is used to manage coherence in relations.
 String getName()
           
 String getOppositeHelperClassName()
          CoherenceHelper class is used to manage coherence in relations.
 String getOppositeHelperFQClassName()
          CoherenceHelper class is used to manage coherence in relations.
 String getOppositeUFLCMRName()
           
 EjbRelationshipRoleDesc getRsr()
           
 String getTypeName()
           
 String getUFLName()
          This is used to generate method names relative to the CMR Field
 boolean isMMb()
           
 boolean isMMu()
           
 boolean isMOb()
           
 boolean isMOu()
           
 boolean isOMb()
           
 boolean isOMu()
           
 boolean isOOb()
           
 boolean isOOu()
           
 String jormGetter()
           
 String jormSetter()
           
 String toString()
           
 String upperFL(String word)
          It capitalizes the first letter of a word.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VcCMRField

public VcCMRField(EjbRelationshipRoleDesc rsr)
           throws GenICException
It builds a cmr field descriptor usable in velocity context.

Parameters:
rsr - The EjbRelationshipRoleDesc where this CMR field is defined
Throws:
GenICException - if the Deployment Decriptor is not conform
Method Detail

getName

public String getName()
Returns:
the name of the cmr field.

getTypeName

public String getTypeName()
Returns:
the type name of the cmr field. It is the referenced class if the relation is multiple, otherwise the type of the multivalued relation (java.util.Collection or java.util.Set).

getUFLName

public String getUFLName()
This is used to generate method names relative to the CMR Field

Returns:
the name of cmr field with the first letter capitalized.

jormGetter

public String jormGetter()

jormSetter

public String jormSetter()

getRsr

public EjbRelationshipRoleDesc getRsr()
Returns:
the JOnAS meta object where the CMR field is defined

getOppositeUFLCMRName

public String getOppositeUFLCMRName()
Returns:
the name of opposite cmr field with the first letter capitalized.

getHelperClassName

public String getHelperClassName()
CoherenceHelper class is used to manage coherence in relations.

Returns:
The JOnAS CoherenceHelper class name

getHelperFQClassName

public String getHelperFQClassName()
CoherenceHelper class is used to manage coherence in relations.

Returns:
The Fully Qualified JOnAS CoherenceHelper class name

getOppositeHelperClassName

public String getOppositeHelperClassName()
CoherenceHelper class is used to manage coherence in relations.

Returns:
The JOnAS CoherenceHelper class name for opposite bean

getOppositeHelperFQClassName

public String getOppositeHelperFQClassName()
CoherenceHelper class is used to manage coherence in relations.

Returns:
The JOnAS CoherenceHelper fully qualified class name for opposite bean

getGenClassName

public String getGenClassName()
Returns:
the class name of the gen class which must be used if the cmr is multiple and return null otherwise. The class which the is returned implements the interface which the name is returned by the 'getTypeName' method.

getElement

public EntityCmp2Desc getElement()
Returns:
the description of the field

upperFL

public String upperFL(String word)
It capitalizes the first letter of a word.

Parameters:
word - is the input string to capitalize the first letter
Returns:
a String with first letter capitalized

isOOu

public boolean isOOu()
Returns:
true if the relationship role is one-one unidirectional, false if not.

isOOb

public boolean isOOb()
Returns:
true if the relationship role is one-one bidirectional, false if not.

isOMu

public boolean isOMu()
Returns:
true if the relationship role is one-many unidirectional, false if not.

isMOu

public boolean isMOu()
Returns:
true if the relationship role is many-one unidirectional, false if not.

isMOb

public boolean isMOb()
Returns:
true if the relationship role is many-one bidirectional, false if not.

isOMb

public boolean isOMb()
Returns:
true if the relationship role is one-many bidirectional, false if not.

isMMu

public boolean isMMu()
Returns:
true if the relationship role is many-many unidirectional, false if not.

isMMb

public boolean isMMb()
Returns:
true if the relationship role is many-many bidirectional, false if not.

toString

public String toString()
Overrides:
toString in class Object
Returns:
a string representation of the VcCMRField object for debug use


Copyright © 2010 OW2 Consortium. All Rights Reserved.