|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TypeParsingService
| Method Summary | |
|---|---|
String |
getCompilationUnitContents(ClassOrInterfaceTypeDetails cid)
Returns the compilation unit contents that represents the passed class or interface details. |
ClassOrInterfaceTypeDetails |
getTypeAtLocation(String fileIdentifier,
String declaredByMetadataId,
org.springframework.roo.model.JavaType javaType)
Builds a ClassOrInterfaceTypeDetails object that represents the
requested JavaType from the type at
the passed in type path. |
ClassOrInterfaceTypeDetails |
getTypeFromString(String typeContents,
String declaredByMetadataId,
org.springframework.roo.model.JavaType javaType)
Builds a ClassOrInterfaceTypeDetails object that represents the
requested JavaType from the passed
compilation unit text. |
String |
updateAndGetCompilationUnitContents(String fileIdentifier,
ClassOrInterfaceTypeDetails cid)
Returns the compilation unit contents that represents the java file updated with the passed class or interface details. |
| Method Detail |
|---|
String getCompilationUnitContents(ClassOrInterfaceTypeDetails cid)
TypeManagementService. One concrete time this
is useful is when an add-on wishes to emulate an ITD-like model for an
external system that cannot support ITDs and may wish to insert a custom
header etc before writing it to disk.
cid - a parsed representation of a class or interface (required)
ClassOrInterfaceTypeDetails getTypeAtLocation(String fileIdentifier,
String declaredByMetadataId,
org.springframework.roo.model.JavaType javaType)
ClassOrInterfaceTypeDetails object that represents the
requested JavaType from the type at
the passed in type path.
fileIdentifier - the location of the type to be parsed (required)declaredByMetadataId - the metadata ID that should be used in the
returned object (required)javaType - the Java type to locate in the compilation unit and parse
(required)
ClassOrInterfaceTypeDetails getTypeFromString(String typeContents,
String declaredByMetadataId,
org.springframework.roo.model.JavaType javaType)
ClassOrInterfaceTypeDetails object that represents the
requested JavaType from the passed
compilation unit text. This is useful if an add-on wishes to parse some
arbitrary compilation unit contents it acquired from outside the user
project, such as a template that ships with the add-on. The add-on can
subsequently modify the returned object (via the builder) and eventually
write the final version to the user's project. This therefore allows more
elegant add-on usage patterns, as they need not write "stub" compilation
units into a user project simply to parse them for subsequent re-writing.
typeContents - the text of a legal Java compilation unit (required)declaredByMetadataId - the metadata ID that should be used in the
returned object (required)javaType - the Java type to locate in the compilation unit and parse
(required)
String updateAndGetCompilationUnitContents(String fileIdentifier,
ClassOrInterfaceTypeDetails cid)
getCompilationUnitContents(ClassOrInterfaceTypeDetails) is that
this method doesn't create a new compilation unit but tries to update the
original return the final file contents.
fileIdentifier - canonical path of filecid - a parsed representation of a class or interface (required)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||