|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.objectweb.jorm.comp.generator.lib.CommonHelper
This class is a helper for the generation. All methods provided in this class are shortcut or facilties which simplify the generation.
| Inner Class Summary | |
class |
CommonHelper.PNGDesc
|
| Field Summary | |
protected org.objectweb.util.monolog.api.Logger |
logger
|
protected org.objectweb.util.monolog.api.LoggerFactory |
loggerFactory
|
static PType[] |
PN_GET_TYPES
|
| Constructor Summary | |
CommonHelper()
|
|
| Method Summary | |
boolean |
canBeNullValue(PType type)
|
boolean |
containsCompositeName(Class c,
CompilerParameter cp)
This method allows to know if a class represented by its Class meta object, contains a composite PName. |
boolean |
containsCompositeReference(Class moc,
CompilerParameter cp)
This method tests if a class contains a composite reference. |
boolean |
containsGenClassRef(Class co)
This method tests if a class references to a generic class. |
boolean |
containsReference(Class co)
This method tests if a class contains a reference. |
boolean |
containsSerializedField(Class co)
This method tests if a class contains a serialized field. |
java.util.Collection |
getCompositeNameDefEntries(NameDef mo)
This method provides an iterator over the map entries which associated a composite field name (key) to the class field name (value). |
java.lang.String |
getFQNOfCompositeName(java.lang.Object o)
|
org.objectweb.util.monolog.api.Logger |
getLogger()
Its retrives the current logger. |
org.objectweb.util.monolog.api.LoggerFactory |
getLoggerFactory()
Its retrives the current logger factory. |
java.lang.String |
getPaGetMethod(PType pt)
This method does the conversion between a PType @pt and the getter function to use on a PAccessorGen (generic accessor). |
java.lang.String |
getPaSetMethod(PType pt)
This method does the conversion between a PType @pt and the setter function to use on a PAccessorGen (generic accessor). |
java.lang.String |
getPNameDecodeFunction(PType pt)
This method permits to find the right decode function either the PType specified by the parameter @pt. |
java.lang.String |
getPNameEncodeFunction(PType pt)
This method permits to find the right encode function either the PType specified by the parameter @pt. |
java.lang.String |
getPNameGetterGetFunction(PType pt)
This method permits to find the right pngetXField function either the PType specified by the parameter @pt. |
PType[] |
getPNGTypes()
|
PrimitiveElement |
getPrimitiveElement(java.lang.Object mo,
Class c,
boolean canBeFieldName)
This method allow to retrieve a primitive element from th meta object mo. |
java.lang.String |
getProjectionField(NameDef nd,
java.lang.String cfn)
This method provides the projection of the field name belonging to the class over a field name belonging to the composite name corresponding definition. |
PType |
getPType(java.lang.String ptn)
|
PType |
getPTypeBigDecimal()
Its retrieves the PType object which represents the BigDecimal jorm type. |
PType |
getPTypeBoolean()
Its retrieves the PType object which represents the boolean jorm type. |
PType |
getPTypeByte()
Its retrieves the PType object which represents the byte jorm type. |
PType |
getPTypeByteArray()
Its retrieves the PType object which represents the bytearray jorm type. |
PType |
getPTypeChar()
Its retrieves the PType object which represents the char jorm type. |
PType |
getPTypeCharArray()
Its retrieves the PType object which represents the chararray jorm type. |
PType |
getPTypeDate()
Its retrieves the PType object which represents the date jorm type. |
PType |
getPTypeDouble()
Its retrieves the PType object which represents the double jorm type. |
PType |
getPTypeFloat()
Its retrieves the PType object which represents the float jorm type. |
PType |
getPTypeInt()
Its retrieves the PType object which represents the int jorm type. |
PType |
getPTypeLong()
Its retrieves the PType object which represents the long jorm type. |
PType |
getPTypeOboolean()
Its retrieves the PType object which represents the Boolean jorm type. |
PType |
getPTypeObyte()
Its retrieves the PType object which represents the Byte jorm type. |
PType |
getPTypeOchar()
Its retrieves the PType object which represents the Character jorm type. |
PType |
getPTypeOdouble()
Its retrieves the PType object which represents the Double jorm type. |
PType |
getPTypeOfloat()
Its retrieves the PType object which represents the Float jorm type. |
PType |
getPTypeOint()
Its retrieves the PType object which represents the Integer jorm type. |
PType |
getPTypeOlong()
Its retrieves the PType object which represents the Long jorm type. |
PType |
getPTypeOshort()
Its retrieves the PType object which represents the Short jorm type. |
PType |
getPTypeReference()
Its retrieves the PType object which represents a reference. |
PType |
getPTypeSerialized()
Its retrieves the PType object which represents the serialized jorm type. |
PType |
getPTypeShort()
Its retrieves the PType object which represents the short jorm type. |
PType |
getPTypeString()
Its retrieves the PType object which represents the string jorm type. |
java.lang.String |
getSchemaName(MetaObject mo)
This method retrieve the schema name for the meta object passed as parameter. |
boolean |
isClass(java.lang.Object o)
This method checks if the parameter is an instance of org.objectweb.jorm.metainfo.api.Class |
boolean |
isClassRef(TypedElement te)
This method checks if the parameter is an instance of org.objectweb.jorm.metainfo.api.ClassRef |
boolean |
isCompositeName(NameDef nd)
This method checks if the NameDef is composed by several fields. |
boolean |
isFieldName(java.lang.Object o)
This method checks if the parameter is an instance of org.objectweb.jorm.metainfo.api.FieldName |
boolean |
isGenClassRef(TypedElement te)
This method checks if the parameter is an instance of org.objectweb.jorm.metainfo.api.GenClassRef |
boolean |
isHiddenField(Class c,
PrimitiveElement pe)
This method checks if the parameter is an instance of org.objectweb.jorm.metainfo.api.PrimitiveElement |
boolean |
isPrimitiveElement(java.lang.Object o)
This method checks if the parameter is an instance of org.objectweb.jorm.metainfo.api.PrimitiveElement |
boolean |
isReference(TypedElement te)
This method checks if the parameter is an instance of org.objectweb.jorm.metainfo.api.Reference |
boolean |
isSerializedField(java.lang.Object o)
This method checks if the parameter designs a Serialized field. |
boolean |
isSerializedType(PType t)
This method checks if the PType parameter designs a Serialized type. |
boolean |
isValidString(java.lang.String str)
This method tests if a String is valid. |
java.util.Iterator |
iterateCompositeName(Class moc,
CompilerParameter cp)
This method return a SET containing the full name of compositename implied in the reference field of the class. |
java.util.ArrayList |
iterateCompositeReference(Class moc,
CompilerParameter cp)
This method return a list containing the nameref implied in composite reference field |
void |
setLogger(org.objectweb.util.monolog.api.Logger l)
Its assigns a logger. |
void |
setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory lf)
Its assigns a logger factory. |
java.lang.String |
upperFL(java.lang.String word)
This methods returns the word specified in parameter with the first character in upper-case. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected org.objectweb.util.monolog.api.LoggerFactory loggerFactory
protected org.objectweb.util.monolog.api.Logger logger
public static final PType[] PN_GET_TYPES
| Constructor Detail |
public CommonHelper()
| Method Detail |
public java.lang.String upperFL(java.lang.String word)
word - The String which the first character must be set in
upper-case
public PrimitiveElement getPrimitiveElement(java.lang.Object mo,
Class c,
boolean canBeFieldName)
throws PException
public boolean containsReference(Class co)
co - The meta object Class
public boolean containsCompositeReference(Class moc,
CompilerParameter cp)
throws java.lang.Exception
moc - The meta object Class
public java.util.ArrayList iterateCompositeReference(Class moc,
CompilerParameter cp)
throws java.lang.Exception
moc - The meta object Class to be analysed.cp - the compiler parameter
public java.util.Iterator iterateCompositeName(Class moc,
CompilerParameter cp)
throws java.lang.Exception
moc - The meta object Classcp - the compiler parameterpublic java.lang.String getSchemaName(MetaObject mo)
mo - The meta objectpublic boolean containsSerializedField(Class co)
co - The meta object Classpublic boolean isValidString(java.lang.String str)
str - The string which must be checkedpublic boolean containsGenClassRef(Class co)
co - The meta object Classpublic boolean isCompositeName(NameDef nd)
nd - the meta object NameDef which must be tested
public java.util.Collection getCompositeNameDefEntries(NameDef mo)
throws java.lang.Exception
nd - the meta object NameDef which must be usedpublic java.lang.String getFQNOfCompositeName(java.lang.Object o)
public boolean containsCompositeName(Class c,
CompilerParameter cp)
public boolean isClass(java.lang.Object o)
o - the object which the type must be checkedpublic boolean isReference(TypedElement te)
o - the object which the type must be checkedpublic boolean isClassRef(TypedElement te)
o - the object which the type must be checkedpublic boolean isGenClassRef(TypedElement te)
o - the object which the type must be checkedpublic boolean isPrimitiveElement(java.lang.Object o)
o - the object which the type must be checked
public boolean isHiddenField(Class c,
PrimitiveElement pe)
o - the object which the type must be checkedpublic boolean isFieldName(java.lang.Object o)
o - the object which the type must be checkedpublic boolean isSerializedField(java.lang.Object o)
o - the object which the type must be checkedpublic boolean isSerializedType(PType t)
o - the PType object which the type must be checked
public java.lang.String getPaGetMethod(PType pt)
throws PException
pt - the ptype which helps to find the right paccessor method
public java.lang.String getPaSetMethod(PType pt)
throws PException
pt - the ptype which helps to find the right paccessor method
public java.lang.String getPNameDecodeFunction(PType pt)
throws PException
pt - the ptype which helps to find the right decode method
public java.lang.String getPNameGetterGetFunction(PType pt)
throws PException
pt - the ptype which helps to find the right pname getter method
public java.lang.String getPNameEncodeFunction(PType pt)
throws PException
pt - the ptype which helps to find the right encode method
public java.lang.String getProjectionField(NameDef nd,
java.lang.String cfn)
throws java.lang.Exception
nd - the meta object NameDef embeding a nameref with a projection.cnf - the field name belonging to the pname in the class.public PType getPType(java.lang.String ptn)
public PType getPTypeBoolean()
public PType getPTypeOboolean()
public PType getPTypeChar()
public PType getPTypeOchar()
public PType getPTypeByte()
public PType getPTypeObyte()
public PType getPTypeShort()
public PType getPTypeOshort()
public PType getPTypeInt()
public PType getPTypeOint()
public PType getPTypeLong()
public PType getPTypeOlong()
public PType getPTypeFloat()
public PType getPTypeOfloat()
public PType getPTypeDouble()
public PType getPTypeOdouble()
public PType getPTypeString()
public PType getPTypeDate()
public PType getPTypeCharArray()
public PType getPTypeByteArray()
public PType getPTypeSerialized()
public PType getPTypeBigDecimal()
public PType getPTypeReference()
public PType[] getPNGTypes()
public boolean canBeNullValue(PType type)
throws PException
public void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory lf)
setLoggerFactory in interface Loggableorg.objectweb.jorm.util.api.Loggableloggerfactory - the LoggerFactory object to obtain new loggerspublic void setLogger(org.objectweb.util.monolog.api.Logger l)
setLogger in interface Loggableorg.objectweb.jorm.util.api.Loggablelogger - the logger objectpublic org.objectweb.util.monolog.api.Logger getLogger()
getLogger in interface Loggableorg.objectweb.jorm.util.api.Loggablelogger - the logger objectpublic org.objectweb.util.monolog.api.LoggerFactory getLoggerFactory()
getLoggerFactory in interface Loggableorg.objectweb.jorm.util.api.Loggableloggerfactory - the LoggerFactory object to obtain new loggers
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||