org.netbeans.api.web.webmodule 1.28

org.netbeans.modules.web.api.webmodule
Class WebModule

java.lang.Object
  extended by org.netbeans.modules.web.api.webmodule.WebModule

public final class WebModule
extends Object

This class encapsulates a web module.

A client may obtain a WebModule instance using method getWebModule(org.openide.filesystems.FileObject), for any FileObject in the web module directory structure.

Use the classpath API to obtain the classpath for the document base (this classpath is used for code completion of JSPs). An example:

     WebModule wm = ...;
     FileObject docRoot = wm.getDocumentBase ();
     ClassPath cp = ClassPath.getClassPath(docRoot, ClassPath.EXECUTE);
 

Note that no particular directory structure for web module is guaranteed by this API.


Field Summary
static String J2EE_13_LEVEL
          Deprecated. 
static String J2EE_14_LEVEL
          Deprecated. 
static String JAVA_EE_5_LEVEL
          Deprecated. 
 
Method Summary
 String getContextPath()
          Returns the context path of the web module.
 FileObject getDeploymentDescriptor()
          Returns the deployment descriptor (web.xml file) of the web module.
 FileObject getDocumentBase()
          Returns the folder that contains sources of the static documents for the web module (html, JSPs, etc.).
 String getJ2eePlatformVersion()
          Deprecated. use getJ2eeProfile()
 org.netbeans.api.j2ee.core.Profile getJ2eeProfile()
           
 FileObject[] getJavaSources()
          Deprecated. This method is deprecated, because its return values does not contain enough information about the source roots. Source roots are usually implemented by a org.netbeans.api.project.SourceGroup, which is more than just a container for a FileObject.
 MetadataModel<WebAppMetadata> getMetadataModel()
          Returns a model describing the metadata of this web module (servlets, resources, etc.).
 FileObject getWebInf()
          Returns the WEB-INF folder for the web module.
static WebModule getWebModule(FileObject file)
          Finds the web module that a given file belongs to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

J2EE_13_LEVEL

@Deprecated
public static final String J2EE_13_LEVEL
Deprecated. 
See Also:
Constant Field Values

J2EE_14_LEVEL

@Deprecated
public static final String J2EE_14_LEVEL
Deprecated. 
See Also:
Constant Field Values

JAVA_EE_5_LEVEL

@Deprecated
public static final String JAVA_EE_5_LEVEL
Deprecated. 
See Also:
Constant Field Values
Method Detail

getWebModule

public static WebModule getWebModule(FileObject file)
Finds the web module that a given file belongs to. The given file should be one known to be owned by a web module (e.g., it can be a file in a Java source group, such as a servlet, or it can be a file in the document base, such as a JSP page).

Parameters:
file - the file to find the web module for; never null.
Returns:
the web module this file belongs to or null if the file does not belong to any web module.
Throws:
NullPointerException - if the file parameter is null.

getDocumentBase

public FileObject getDocumentBase()
Returns the folder that contains sources of the static documents for the web module (html, JSPs, etc.).

Returns:
the static documents folder; can be null.

getWebInf

public FileObject getWebInf()
Returns the WEB-INF folder for the web module. It may return null for web module that does not have any WEB-INF folder.

The WEB-INF folder would typically be a child of the folder returned by getDocumentBase() but does not need to be.

Returns:
the WEB-INF folder; can be null.

getDeploymentDescriptor

public FileObject getDeploymentDescriptor()
Returns the deployment descriptor (web.xml file) of the web module.
The web.xml file would typically be a child of the folder returned by getWebInf() but does not need to be.

Returns:
the web.xml file; can be null.

getContextPath

public String getContextPath()
Returns the context path of the web module.

Returns:
the context path; can be null.

getJ2eePlatformVersion

public String getJ2eePlatformVersion()
Deprecated. use getJ2eeProfile()

Returns the J2EE platform version of this module. The returned value is one of the properties string for constants defined in Profile.

Returns:
J2EE platform version; never null.

getJ2eeProfile

public org.netbeans.api.j2ee.core.Profile getJ2eeProfile()

getJavaSources

@Deprecated
public FileObject[] getJavaSources()
Deprecated. This method is deprecated, because its return values does not contain enough information about the source roots. Source roots are usually implemented by a org.netbeans.api.project.SourceGroup, which is more than just a container for a FileObject.

Returns the Java source roots associated with the web module.

Note that not all the java source roots in the project (e.g. in a freeform project) belong to the web module.

Returns:
this web module's Java source roots; never null.

getMetadataModel

public MetadataModel<WebAppMetadata> getMetadataModel()
Returns a model describing the metadata of this web module (servlets, resources, etc.).

Returns:
this web module's metadata model; never null.

org.netbeans.api.web.webmodule 1.28

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.