org.springframework.roo.classpath.operations
Interface ClasspathOperations

All Known Implementing Classes:
ClasspathOperationsImpl

public interface ClasspathOperations

Provides a common set of operations for Java types.

Since:
1.0
Author:
Ben Alex

Method Summary
 void addEnumConstant(String physicalTypeIdentifier, org.springframework.roo.model.JavaSymbolName constantName)
           
 void addField(FieldMetadata fieldMetadata)
          Adds a new field to an existing class.
 void generateClassFile(ClassOrInterfaceTypeDetails details)
          Creates a new class, with the location name name provided in the details.
 ClassOrInterfaceTypeDetails getClassOrInterface(org.springframework.roo.model.JavaType requiredClassOrInterface)
          Obtains the requested JavaType, assuming it is a class or interface that exists at this time and can be parsed.
 String getPhysicalLocationCanonicalPath(org.springframework.roo.model.JavaType javaType, org.springframework.roo.project.Path path)
           
 String getPhysicalLocationCanonicalPath(String physicalTypeIdentifier)
           
 ClassOrInterfaceTypeDetails getSuperclass(org.springframework.roo.model.JavaType superclass)
          Obtains the superclass, if one is specified.
 boolean isPersistentClassAvailable()
           
 boolean isProjectAvailable()
           
 void newDod(org.springframework.roo.model.JavaType entity, org.springframework.roo.model.JavaType name, org.springframework.roo.project.Path path)
          Creates a new data on demand provider for the entity.
 void newIntegrationTest(org.springframework.roo.model.JavaType entity)
          Creates an integration test for the entity.
 

Method Detail

isProjectAvailable

boolean isProjectAvailable()

isPersistentClassAvailable

boolean isPersistentClassAvailable()

getPhysicalLocationCanonicalPath

String getPhysicalLocationCanonicalPath(org.springframework.roo.model.JavaType javaType,
                                        org.springframework.roo.project.Path path)

getPhysicalLocationCanonicalPath

String getPhysicalLocationCanonicalPath(String physicalTypeIdentifier)

getSuperclass

ClassOrInterfaceTypeDetails getSuperclass(org.springframework.roo.model.JavaType superclass)
Obtains the superclass, if one is specified.

Throws an exception is a superclass was requested but could not be parsed or found.

Parameters:
superclass - requested superclass (can be null)
Returns:
null if a superclass is not requested or not required (ie java.lang.Object)

getClassOrInterface

ClassOrInterfaceTypeDetails getClassOrInterface(org.springframework.roo.model.JavaType requiredClassOrInterface)
Obtains the requested JavaType, assuming it is a class or interface that exists at this time and can be parsed. If these assumption are not met, an exception will be thrown.

Parameters:
requiredClassOrInterface - that should be parsed (required)
Returns:
the details (never returns null)

generateClassFile

void generateClassFile(ClassOrInterfaceTypeDetails details)
Creates a new class, with the location name name provided in the details.

An exception is thrown if the class already exists.

Parameters:
details - to create (required)

addEnumConstant

void addEnumConstant(String physicalTypeIdentifier,
                     org.springframework.roo.model.JavaSymbolName constantName)

addField

void addField(FieldMetadata fieldMetadata)
Adds a new field to an existing class.

An exception is thrown if the class does not exist, cannot be modified or a field with the requested name is already declared.

Parameters:
fieldMetadata - to add (required)

newIntegrationTest

void newIntegrationTest(org.springframework.roo.model.JavaType entity)
Creates an integration test for the entity. Automatically produces a data on demand if one does not exist. Silently returns if the integration test file already exists.

Parameters:
entity - to produce an integration test for (required)

newDod

void newDod(org.springframework.roo.model.JavaType entity,
            org.springframework.roo.model.JavaType name,
            org.springframework.roo.project.Path path)
Creates a new data on demand provider for the entity. Silently returns if the DOD already exists.

Parameters:
entity - to produce a data on demand provider for (required)
name - the name of the new data on demand class (required)
path - the location for the new data on demand class (required)


Copyright © 2009-2010 VMware, Inc. All Rights Reserved.