org.netbeans.modules.j2ee.deployment.common.api
Class SourceFileMap

java.lang.Object
  extended by org.netbeans.modules.j2ee.deployment.common.api.SourceFileMap

public abstract class SourceFileMap
extends Object

Extra file mapping service for each j2ee module. This service cover irregular source to distribution file mapping. Users of the mapping could update the mapping. Provider of the mapping has to ensure the mapping persistence. Note: the initial design is for non-static configuration file such as schema file used in CMP mapping, but it could be used to expose any kind of source-to-distribution mapping.


Constructor Summary
SourceFileMap()
           
 
Method Summary
abstract  boolean add(String distributionPath, org.openide.filesystems.FileObject sourceFile)
          Add new mapping or update existing mapping of the given distribution path.
abstract  org.openide.filesystems.FileObject[] findSourceFile(String distributionPath)
          Returns the concrete file for the given distribution path.
static SourceFileMap findSourceMap(javax.enterprise.deploy.model.DDBean ddbean)
          Returns a source file map for the module, or null if none can be identified.
static SourceFileMap findSourceMap(javax.enterprise.deploy.model.DeployableObject deployable)
          Returns a source file map for the module, or null if none can be identified.
static SourceFileMap findSourceMap(org.openide.filesystems.FileObject source)
          Returns a source file map for the module, or null if none can be identified.
abstract  String getContextName()
          Return context name, typically the J2EE module project name.
abstract  File getDistributionPath(org.openide.filesystems.FileObject sourceFile)
          Returns the relative path in distribution of the given concrete source file.
abstract  File getEnterpriseResourceDir()
          Returns directory paths to repository of enterprise resource definition files.
abstract  File[] getEnterpriseResourceDirs()
          Returns directory paths to repository of enterprise resource definition files.
abstract  org.openide.filesystems.FileObject[] getSourceRoots()
          Return source roots this file mapping is operate on.
abstract  org.openide.filesystems.FileObject remove(String distributionPath)
          Remove mapping for the given distribution path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceFileMap

public SourceFileMap()
Method Detail

findSourceFile

public abstract org.openide.filesystems.FileObject[] findSourceFile(String distributionPath)
Returns the concrete file for the given distribution path.

Parameters:
distributionPath - distribution path for to find source file for.

getDistributionPath

public abstract File getDistributionPath(org.openide.filesystems.FileObject sourceFile)
Returns the relative path in distribution of the given concrete source file.

Parameters:
distributionPath - distribution path for to find source file for.

getSourceRoots

public abstract org.openide.filesystems.FileObject[] getSourceRoots()
Return source roots this file mapping is operate on.


getContextName

public abstract String getContextName()
Return context name, typically the J2EE module project name.


getEnterpriseResourceDir

public abstract File getEnterpriseResourceDir()
Returns directory paths to repository of enterprise resource definition files. If the directories pointed to by the returned path does not exists writing user of the method call could attempt to create it.


getEnterpriseResourceDirs

public abstract File[] getEnterpriseResourceDirs()
Returns directory paths to repository of enterprise resource definition files. If the directories pointed to by the returned path does not exists writing user of the method call could attempt to create it. For a stand-alone J2EE module, the returned list should contain only one path as returned by getEnterpriseResourceDir. For J2EE application module, the list contains resource directory paths of all child modules.


add

public abstract boolean add(String distributionPath,
                            org.openide.filesystems.FileObject sourceFile)
Add new mapping or update existing mapping of the given distribution path. Provider of the mapping needs to extract and persist the relative path to ensure the mapping is in project sharable data. The mapping would be used in ensuring that during build time the source file is put at the right relative path in the distribution content.

Parameters:
distributionPath - file path in the distribution content
sourceFile - souce concrete file object.
Returns:
true if added successfully; false if source file is out of this mapping scope.

remove

public abstract org.openide.filesystems.FileObject remove(String distributionPath)
Remove mapping for the given distribution path.

Parameters:
distributionPath - file path in the distribution content

findSourceMap

public static final SourceFileMap findSourceMap(org.openide.filesystems.FileObject source)
Returns a source file map for the module, or null if none can be identified.

Parameters:
source - A non-null source file (java, descriptor or dbschema) to establish mapping context.

findSourceMap

public static final SourceFileMap findSourceMap(javax.enterprise.deploy.model.DDBean ddbean)
Returns a source file map for the module, or null if none can be identified.

Parameters:
ddbean - An instance of ddbean to establish mapping context.

findSourceMap

public static final SourceFileMap findSourceMap(javax.enterprise.deploy.model.DeployableObject deployable)
Returns a source file map for the module, or null if none can be identified.

Parameters:
ddbean - An instance of ddbean to establish mapping context.

 

Built on March 27 2006.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.