org.springframework.roo.classpath
Class PhysicalTypeIdentifier

java.lang.Object
  extended by org.springframework.roo.classpath.PhysicalTypeIdentifier

public final class PhysicalTypeIdentifier
extends Object

Provides string manipulation functions for PhysicalTypeMetadata IDs.

Since:
1.0
Author:
Ben Alex

Field Summary
static String PHYSICAL_METADATA_TYPE_ID
          The class-level ID for physical type metadata.
 
Method Summary
static String createIdentifier(org.springframework.roo.model.JavaType javaType, org.springframework.roo.project.LogicalPath path)
          Creates a physical type metadata ID for the given user project type, which need not exist.
static String getFriendlyName(String metadataId)
           
static org.springframework.roo.model.JavaType getJavaType(String physicalTypeId)
          Parses the given metadata ID for the user project type to which it relates.
static String getMetadataIdentiferType()
          Returns the class-level ID for physical type metadata.
static org.springframework.roo.project.LogicalPath getPath(String metadataId)
          Parses the given metadata ID for the path of the user project type to which it relates.
static boolean isValid(String metadataIdentificationString)
          Indicates whether the given metadata ID identifies a physical Java type, in other words an interface, class, annotation, or enum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PHYSICAL_METADATA_TYPE_ID

public static final String PHYSICAL_METADATA_TYPE_ID
The class-level ID for physical type metadata.

Since:
1.2.0
Method Detail

createIdentifier

public static String createIdentifier(org.springframework.roo.model.JavaType javaType,
                                      org.springframework.roo.project.LogicalPath path)
Creates a physical type metadata ID for the given user project type, which need not exist. If you know the JavaType exists but don't know its LogicalPath, you can use TypeLocationService.getPhysicalTypeIdentifier(JavaType) instead.

Parameters:
javaType - the type for which to create the identifier (required)
path - the path in which it's located (required)
Returns:
a non-blank ID

getFriendlyName

public static String getFriendlyName(String metadataId)

getJavaType

public static org.springframework.roo.model.JavaType getJavaType(String physicalTypeId)
Parses the given metadata ID for the user project type to which it relates.

Parameters:
physicalTypeId - the metadata ID to parse (must identify an instance of PHYSICAL_METADATA_TYPE)
Returns:
a non-null type

getMetadataIdentiferType

public static String getMetadataIdentiferType()
Returns the class-level ID for physical type metadata. Equivalent to accessing PHYSICAL_METADATA_TYPE_ID directly.

Returns:

getPath

public static org.springframework.roo.project.LogicalPath getPath(String metadataId)
Parses the given metadata ID for the path of the user project type to which it relates.

Parameters:
metadataId - the metadata ID to parse (must identify an instance of PHYSICAL_METADATA_TYPE)
Returns:
a non-null path

isValid

public static boolean isValid(String metadataIdentificationString)
Indicates whether the given metadata ID identifies a physical Java type, in other words an interface, class, annotation, or enum.

Parameters:
metadataIdentificationString - the metadata ID to check
Returns:
see above


Copyright © 2009–2015. All rights reserved.