public final class WebModule extends Object
A client may obtain a WebModule
instance using
method WebModule.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.
Modifier and Type | Field and Description |
---|---|
static String |
J2EE_13_LEVEL
Deprecated.
|
static String |
J2EE_14_LEVEL
Deprecated.
|
static String |
JAVA_EE_5_LEVEL
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
@Deprecated public static final String J2EE_13_LEVEL
@Deprecated public static final String J2EE_14_LEVEL
@Deprecated public static final String JAVA_EE_5_LEVEL
public static WebModule getWebModule(FileObject file)
file
- the file to find the web module for; never null.NullPointerException
- if the file
parameter is null.public FileObject getDocumentBase()
public FileObject getWebInf()
The WEB-INF folder would typically be a child of the folder returned
by WebModule.getDocumentBase()
but does not need to be.
public FileObject getDeploymentDescriptor()
web.xml
file) of the web module.
WebModule.getWebInf()
but does not need to be.
web.xml
file; can be null.public String getContextPath()
@Deprecated public String getJ2eePlatformVersion()
WebModule.getJ2eeProfile()
Profile
.public org.netbeans.api.j2ee.core.Profile getJ2eeProfile()
@Deprecated public FileObject[] getJavaSources()
org.netbeans.api.project.SourceGroup
,
which is more than just a container for a FileObject
.Note that not all the java source roots in the project (e.g. in a freeform project) belong to the web module.
public MetadataModel<WebAppMetadata> getMetadataModel()