|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jalios.jcms.TypeProcessor
public class TypeProcessor
This class generates all the resources (Java classes and JSPs) used by the Custom Publication Types and Custom Extension Types.
This class replaces TypeGenerator class. It uses now a template mechanism to produces all the source code (Java and JSP)
| Field Summary | |
|---|---|
protected List<String> |
compileList
|
protected ArrayList<String> |
compilerCmdLine
|
static TypeFieldEntry[] |
EMPTY_TYPEFIELDENTRY_ARRAY
|
protected List<String> |
extendedTypeList
|
protected Map<String,String> |
extensionsTabsMap
|
protected List<Class<?>> |
hbmList
|
static String |
REVISION
|
protected Runtime |
rt
|
| Fields inherited from interface com.jalios.jcms.TypeConstants |
|---|
CHANGE_LEVEL_CLASS, CHANGE_LEVEL_JSP, CHANGE_LEVEL_NONE, DISPLAY_TPLT_TAG, EXTENSIONS_XML, FIELD_ELT, FIELD_NEW_MARK, FIELD_UPDATED_MARK, FIELDS_ELT, FILE_INDEX_LISTENER, LINK_INDEX_LISTENER, OLD_TYPES_DIR, PACKAGE_NAME, QUERY_TPLT_TAG, TAB_ELT, TABS_ELT, TEMPLATE_TAG, TEMPLATES_SUFFIX, TEMPLATES_TAG, TITLE_ELT, TYPE_ELT, TYPE_FORCE_UPDATE_MARK, TYPE_NEW_MARK, TYPE_UPDATED_MARK, TYPES_DIR, TYPES_XML |
| Fields inherited from interface com.jalios.util.JaliosConstants |
|---|
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR |
| Method Summary | |
|---|---|
void |
applyTypeChange()
|
TypeFieldEntry[] |
getAllTypeFieldEntries(Class<?> clazz)
Return an array of TypeFieldEntry bound to given Class. |
TypeFieldEntry[] |
getAllTypeFieldEntries(String clazzName)
Return an array of TypeFieldEntry bound to given Class represented by its class name. |
org.jdom.Document |
getCurrentTypeDocument()
|
Map<String,Class<?>> |
getCustomExtensionMap()
Retrieves the map of custom extension |
List<Class<?>> |
getCustomTypeList()
|
List<String> |
getExtendedTypeList()
Returns all the classes which have a Data extension. |
Map<String,String> |
getExtensionsTabsMap()
|
List<Class<?>> |
getHbmList()
Returns the list of class an HBM has been generated. |
static TypeProcessor |
getInstance()
Returns the TypeProcessor singleton instance. |
org.jdom.Document |
getNewTypeDocument(boolean create)
|
int |
getTypeChangeLevel()
|
String |
getTypeDescription(Class<?> clazz,
String lang)
Returns the description of a given type (class) localized for the given language. |
org.jdom.Document |
getTypeDocument()
|
TypeEntry |
getTypeEntry(Class<?> clazz)
Return the TypeEntry class associated to the given Class. |
TypeEntry |
getTypeEntry(String clazzName)
Return the TypeEntry class associated to the given Class name. |
TypeFieldEntry[] |
getTypeFieldEntries(Class<?> clazz)
Return an array of TypeFieldEntry bound to given Class. |
TypeFieldEntry[] |
getTypeFieldEntries(String clazzName)
Return an array of TypeFieldEntry bound to given Class represented by its class name. |
String |
getTypeLabel(Class<?> clazz)
Deprecated. since jcms-5.7.0 |
String |
getTypeLabel(Class<?> clazz,
String lang)
Returns the label of a given type (class) localized for the given language. |
boolean |
isCompilationDone()
|
boolean |
isInGeneratedDir(File file)
Looks if the file is under a generation files (classes/generated and types). |
static void |
markTypeAsUpdated(org.jdom.Element typeElt,
boolean markSubTypes,
boolean forceUpdate)
Mark the given type as updated and also its sub-types (and their "super" field) |
void |
processTypes()
Generate all type's resources from the types/ directory (for old JCMS data, convert types.xml file, to the new types organization and extensions.xml file to the new extensions organization) |
void |
revertTypeDocument()
Revert the currently edited TypeDocument. |
void |
saveNewTypeDocument(boolean restartChannel)
Saves the currently edited TypeDocument. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String REVISION
public static final TypeFieldEntry[] EMPTY_TYPEFIELDENTRY_ARRAY
protected List<String> extendedTypeList
protected Map<String,String> extensionsTabsMap
protected ArrayList<String> compilerCmdLine
protected Runtime rt
protected List<String> compileList
protected List<Class<?>> hbmList
| Method Detail |
|---|
public static TypeProcessor getInstance()
public org.jdom.Document getCurrentTypeDocument()
public org.jdom.Document getTypeDocument()
public org.jdom.Document getNewTypeDocument(boolean create)
create - whether a new one should be created if it has not been created yet
getTypeDocument() being edited)public void revertTypeDocument()
public List<Class<?>> getCustomTypeList()
public Map<String,Class<?>> getCustomExtensionMap()
public List<String> getExtendedTypeList()
public Map<String,String> getExtensionsTabsMap()
public List<Class<?>> getHbmList()
public void processTypes()
throws Exception
Exceptionpublic boolean isInGeneratedDir(File file)
file - A possibly generated file
public void saveNewTypeDocument(boolean restartChannel)
throws IOException
restartChannel - if true, once the new types was
successfully saved, the channel is restarted
IOException - if an error occurs during saving
public void applyTypeChange()
throws Exception
Exceptionpublic int getTypeChangeLevel()
public TypeEntry getTypeEntry(Class<?> clazz)
clazz.
clazz - the Class of which to find the TypeEntry
TypeEntry associated to the given class or null if not available.public TypeEntry getTypeEntry(String clazzName)
clazzName.
clazzName - the String representing the name the Class of which to find the TypeEntry
TypeEntry associated to the given class or null if not available.public TypeFieldEntry[] getTypeFieldEntries(Class<?> clazz)
TypeFieldEntry bound to given Class. Class.
clazz - the Class of which to find the TypeFieldEntry.
TypeFieldEntry containing all Field used by Class or an empty array (never return null)public TypeFieldEntry[] getTypeFieldEntries(String clazzName)
TypeFieldEntry bound to given Class represented by its class name. Class.
clazzName - the String representing the name the Class of which to find the TypeFieldEntry
TypeFieldEntry containing all Field used by Class or an empty array (never return null)public TypeFieldEntry[] getAllTypeFieldEntries(Class<?> clazz)
TypeFieldEntry bound to given Class. Class.
clazz - the Class of which to find the TypeFieldEntry.
TypeFieldEntry containing all Field used by Class or an empty array (never return null)public TypeFieldEntry[] getAllTypeFieldEntries(String clazzName)
TypeFieldEntry bound to given Class represented by its class name. Class.
clazzName - the String representing the name the Class of which to find the TypeFieldEntry
TypeFieldEntry containing all Field used by Class or an empty array (never return null)@Deprecated public String getTypeLabel(Class<?> clazz)
clazz - the class to get the label
getTypeLabel(Class, String)
public String getTypeLabel(Class<?> clazz,
String lang)
clazz - the classlang - the language
public String getTypeDescription(Class<?> clazz,
String lang)
clazz - the classlang - the language
public static void markTypeAsUpdated(org.jdom.Element typeElt,
boolean markSubTypes,
boolean forceUpdate)
typeElt - the type to mark as updatedmarkSubTypes - if true, marks all its sub-types as updatedforceUpdate - if true, the type (and sub-types if
'markSubTypes' is true) will be force to be updated
(i.e. regenerated)public boolean isCompilationDone()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||