public final class PhysicalTypeIdentifierNamingUtils extends Object
JavaType
located in a particular LogicalPath.
The metadata identification strings separate the path name from the fully
qualified type name via the presence of a question mark character ("?"). A
question mark is used given it is reserved by Path. TODO these
methods are not specific to physical types; either rename this class, move
them somewhere more generic, and/or make them more specific, e.g. hardcode
the "metadata class" arguments to that of physical types.
| Modifier and Type | Method and Description |
|---|---|
static String |
createIdentifier(String metadataClass,
org.springframework.roo.model.JavaType projectType,
org.springframework.roo.project.LogicalPath path)
Creates a metadata ID from the given inputs
|
static org.springframework.roo.model.JavaType |
getJavaType(String metadataIdentificationString) |
static org.springframework.roo.model.JavaType |
getJavaType(String metadataClass,
String metadataId)
Returns the user project type with which the given metadata ID is
associated.
|
static String |
getModule(String metadataId)
Returns the name of the project module that contains the metadata item
with the given id.
|
static String |
getModuleFromIdentificationString(String metadataId)
Extracts module name from a metadata identification string
|
static org.springframework.roo.project.LogicalPath |
getPath(String metadataId)
Returns the
LogicalPath of the metadata item with the given id. |
static org.springframework.roo.project.LogicalPath |
getPath(String providesType,
String metadataIdentificationString)
Parses the user project path from the given metadata ID.
|
static boolean |
isValid(String metadataClass,
String metadataId)
Indicates whether the given metadata id appears to identify an instance
of the given metadata class.
|
public static String createIdentifier(String metadataClass, org.springframework.roo.model.JavaType projectType, org.springframework.roo.project.LogicalPath path)
metadataClass - the fully-qualified name of the metadata class
(required)projectType - the fully-qualified name of the user project type to
which the metadata relates (required)path - the path to that type within the project (required)public static org.springframework.roo.model.JavaType getJavaType(String metadataIdentificationString)
public static org.springframework.roo.model.JavaType getJavaType(String metadataClass, String metadataId)
metadataClass - the fully-qualified name of the metadata type
(required)metadataId - the ID of the metadata instance (must identify an
instance of the given metadata class)null typepublic static String getModule(String metadataId)
metadataId - must be a valid metadata instance idnull module name (blank means the root or only
module)public static org.springframework.roo.project.LogicalPath getPath(String metadataId)
LogicalPath of the metadata item with the given id.metadataId - must be a valid metadata instance idnull pathpublic static org.springframework.roo.project.LogicalPath getPath(String providesType, String metadataIdentificationString)
metadataClass - the fully-qualified name of the metadata type
(required)metadataId - the ID of the metadata instance (must identify an
instance of the given metadata class)null pathpublic static boolean isValid(String metadataClass, String metadataId)
metadataClass - the fully-qualified name of the expected metadata
type (can be blank)metadataId - the ID to evaluate (can be blank)Copyright © 2009–2018 Pivotal Software, Inc.. All rights reserved.