|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.cargo.module.webapp.WebXmlUtils
public final class WebXmlUtils
Method Summary | |
---|---|
static void |
addContextParam(WebXml webXml,
String name,
String value)
Adds a new context-param element to the descriptor. |
static void |
addEjbRef(WebXml webXml,
EjbRef ref)
Add an EJB Reference. |
static void |
addFilter(WebXml webXml,
Filter filter)
|
static void |
addFilter(WebXml webXml,
String filterName,
String filterClass)
Add a filter to the descriptor. |
static void |
addFilterInitParam(WebXml webXml,
String name,
String paramName,
String paramValue)
Add an init param to a filter. |
static void |
addFilterMapping(WebXml webXml,
FilterMapping rhs)
|
static void |
addJspFile(WebXml webXml,
String theServletName,
String theJspFile)
Add a JSP file. |
static void |
addSecurityConstraint(WebXml webXml,
String theWebResourceName,
String theUrlPattern,
List theRoles)
Add a security constraint. |
static void |
addSecurityRole(WebXml webXml,
String theRoleName)
|
static void |
addServlet(WebXml webXml,
Servlet element)
Add a servlet to the web xml. |
static void |
addServlet(WebXml webXml,
String servletName,
String servletClass)
Add a servlet to the descriptor. |
static void |
addServletInitParam(WebXml webXml,
String theServletName,
String name,
String value)
Add an init param to a servlet. |
static void |
addServletMapping(WebXml webXml,
String theServletName,
String theUrlPattern)
|
static void |
addServletRunAsRoleName(WebXml webXml,
String theServletName,
String theRoleName)
|
static void |
addTagInitParam(WebXmlElement itemElement,
String name,
String value)
Add an init-param to the web xml. |
static org.jdom.Element |
getContextParam(WebXml webXml,
String paramName)
Returns the element that contains the definition of a specific context param, or null if a context param of the specified name is not defined in the
descriptor. |
static Filter |
getFilter(WebXml theWebXml,
String filterName)
|
static String |
getFilterInitParam(WebXml theWebXml,
String filterName,
String paramName)
|
static Iterator |
getFilterInitParamNames(WebXml webXml,
String name)
Get the init parameter names for a filter. |
static Iterator |
getFilterMappingElements(WebXml webXml,
String theFilterName)
Returns the filter mappings that the specified filter is mapped to in an ordered list. |
static Iterator |
getFilterMappings(WebXml webXml,
String theFilterName)
Returns the URL-patterns that the specified filter is mapped to in an ordered list. |
static Iterator |
getFilterNames(WebXml webXml)
|
static Iterator |
getFilterNamesForClass(WebXml webXml,
String className)
Returns a list of names of filters that are mapped to the specified class. |
static String |
getLoginConfigAuthMethod(WebXml webXml)
Get the login config authorization method. |
static SecurityConstraint |
getSecurityConstraint(WebXml webXml,
String theUrlPattern)
Get a security constraint by URL. |
static org.jdom.Element |
getSecurityRole(WebXml webXml,
String theRoleName)
Get the security role by name. |
static Iterator |
getSecurityRoleNames(WebXml webXml)
Get the security role names. |
static Servlet |
getServlet(WebXml theWebXml,
String servletName)
|
static String |
getServletInitParam(WebXml theWebXml,
String servletName,
String paramName)
|
static Iterator |
getServletInitParamNames(WebXml webXml,
String theServletName)
Get the names of all the servlet init parameters. |
static Iterator |
getServletMappings(WebXml webXml,
String theServletName)
Get the servlet mappings to the named servlet. |
static Iterator |
getServletNames(WebXml webXml)
Get an iterator of the servlet names in the web xml. |
static Iterator |
getServletNamesForClass(WebXml webXml,
String className)
Get the names that this servlet uses. |
static Iterator |
getServletNamesForJspFile(WebXml webXml,
String theJspFile)
Returns a list of names of servlets that are mapped to the specified JSP file. |
static String |
getServletRunAsRoleName(WebXml webXml,
String theServletName)
For a named servlet, return the run-as role name. |
static boolean |
hasContextParam(WebXml webXml,
String theParamName)
Returns whether a context param by the specified name is defined in the deployment descriptor. |
static boolean |
hasFilter(WebXml webXml,
String theFilterName)
Returns whether a servlet filter by the specified name is defined in the deployment descriptor. |
static boolean |
hasLoginConfig(WebXml webXml)
Does the descriptor have a login config? |
static boolean |
hasSecurityConstraint(WebXml webXml,
String theUrlPattern)
Does the descriptor have a security constraint for a URL? |
static boolean |
hasSecurityRole(WebXml webXml,
String theRoleName)
Does the role have a security definition? |
static boolean |
hasServlet(WebXml webXml,
String servletName)
Does the web xml have a named servlet. |
static void |
setLoginConfig(WebXml webXml,
String theAuthMethod,
String theRealmName)
Set the login config. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Iterator getFilterNamesForClass(WebXml webXml, String className)
webXml
- The webXml file to useclassName
- The fully qualified name of the filter class
public static Iterator getFilterMappings(WebXml webXml, String theFilterName)
webXml
- The webXml file to usetheFilterName
- The name of the servlet filter of which the mappings should be retrieved
public static Iterator getFilterMappingElements(WebXml webXml, String theFilterName)
webXml
- The webXml file to usetheFilterName
- The name of the servlet filter of which the mappings should be retrieved
public static boolean hasContextParam(WebXml webXml, String theParamName)
webXml
- The webXml file to usetheParamName
- The name of the context param
true
if the context param is defined, false
otherwisepublic static org.jdom.Element getContextParam(WebXml webXml, String paramName)
null
if a context param of the specified name is not defined in the
descriptor.
webXml
- The webXml file to useparamName
- The context param name
public static boolean hasFilter(WebXml webXml, String theFilterName)
webXml
- The webXml file to usetheFilterName
- The name of the filter
true
if the filter is defined, false
otherwisepublic static String getServletRunAsRoleName(WebXml webXml, String theServletName)
webXml
- The webXml file to usetheServletName
- the name of the servlet
public static void addTagInitParam(WebXmlElement itemElement, String name, String value)
itemElement
- The the parent element to add toname
- The name of the paramvalue
- The value for the parampublic static Iterator getFilterInitParamNames(WebXml webXml, String name)
webXml
- The webXml file to usename
- The name of the filter to use
public static void addFilterInitParam(WebXml webXml, String name, String paramName, String paramValue)
webXml
- The webXml file to usename
- The name of the filterparamName
- The name of the parameterparamValue
- The value of the parameterpublic static boolean hasServlet(WebXml webXml, String servletName)
webXml
- The webXml file to useservletName
- The name of the servlet
true
if it does, false
if not.public static void addServlet(WebXml webXml, String servletName, String servletClass)
webXml
- The webXml file to useservletName
- The servlet nameservletClass
- The servlet class namepublic static Iterator getServletNamesForClass(WebXml webXml, String className)
webXml
- The webXml file to useclassName
- the name of the class
public static Iterator getServletNamesForJspFile(WebXml webXml, String theJspFile)
webXml
- The webXml file to usetheJspFile
- The path to the JSP file, relative to the root of the web-application
public static Iterator getServletNames(WebXml webXml)
webXml
- The webXml file to use
public static Iterator getServletMappings(WebXml webXml, String theServletName)
webXml
- The webXml file to usetheServletName
- The name of the servlet
public static void addServlet(WebXml webXml, Servlet element)
webXml
- The webXml file to useelement
- The servlet elementpublic static void addServletInitParam(WebXml webXml, String theServletName, String name, String value)
webXml
- The webXml file to usetheServletName
- The name of the servletname
- The name of the init paramvalue
- The value for the init parampublic static Iterator getServletInitParamNames(WebXml webXml, String theServletName)
webXml
- The webXml file to usetheServletName
- The name of the servlet
public static void addSecurityConstraint(WebXml webXml, String theWebResourceName, String theUrlPattern, List theRoles)
webXml
- The webXml file to usetheWebResourceName
- The name of the web resourcetheUrlPattern
- The URL PatterntheRoles
- the Roles to Allow
InvocationTargetException
IllegalAccessException
InstantiationException
NoSuchMethodException
IllegalArgumentException
SecurityException
public static void addJspFile(WebXml webXml, String theServletName, String theJspFile)
webXml
- The webXml file to usetheServletName
- The name of the servlettheJspFile
- The name of the JSP file
InvocationTargetException
IllegalAccessException
InstantiationException
NoSuchMethodException
IllegalArgumentException
SecurityException
public static boolean hasSecurityConstraint(WebXml webXml, String theUrlPattern)
webXml
- The webXml file to usetheUrlPattern
- The URL pattern to query
public static boolean hasLoginConfig(WebXml webXml)
webXml
- The webXml file to use
public static void setLoginConfig(WebXml webXml, String theAuthMethod, String theRealmName)
webXml
- The webXml file to usetheAuthMethod
- The authorization methodtheRealmName
- The realm namepublic static String getLoginConfigAuthMethod(WebXml webXml)
webXml
- The webXml file to use
public static SecurityConstraint getSecurityConstraint(WebXml webXml, String theUrlPattern)
webXml
- The webXml file to usetheUrlPattern
- The URL Pattern
public static boolean hasSecurityRole(WebXml webXml, String theRoleName)
webXml
- The webXml file to usetheRoleName
- The name of the role
public static Iterator getSecurityRoleNames(WebXml webXml)
webXml
- The webXml file to use
public static org.jdom.Element getSecurityRole(WebXml webXml, String theRoleName)
webXml
- The webXml file to usetheRoleName
- The name of the role
public static void addEjbRef(WebXml webXml, EjbRef ref)
webXml
- The webXml file to useref
- the EJB Reference element to addpublic static void addSecurityRole(WebXml webXml, String theRoleName)
webXml
- The webXml file to usetheRoleName
- The role name to usepublic static Servlet getServlet(WebXml theWebXml, String servletName)
theWebXml
- The webXml file to useservletName
- The name of the servlet to get
public static Iterator getFilterNames(WebXml webXml)
webXml
- The webXml file to use
public static Filter getFilter(WebXml theWebXml, String filterName)
theWebXml
- The webXml file to usefilterName
- The name of the filter
public static void addFilterMapping(WebXml webXml, FilterMapping rhs)
webXml
- The webXml file to userhs
- The mapping to addpublic static String getServletInitParam(WebXml theWebXml, String servletName, String paramName)
theWebXml
- The webXml file to useservletName
- The servlet nameparamName
- The parameter Name
public static void addServletRunAsRoleName(WebXml webXml, String theServletName, String theRoleName)
webXml
- The webXml file to usetheServletName
- The name of the servlettheRoleName
- The role name to addpublic static void addServletMapping(WebXml webXml, String theServletName, String theUrlPattern)
webXml
- The webXml file to usetheServletName
- The name of the servlettheUrlPattern
- the URL PAttern to addpublic static String getFilterInitParam(WebXml theWebXml, String filterName, String paramName)
theWebXml
- The webXml file to usefilterName
- The name of the filterparamName
- The name of the parameter
public static void addFilter(WebXml webXml, Filter filter)
webXml
- The webXml file to usefilter
- The filter to addpublic static void addFilter(WebXml webXml, String filterName, String filterClass)
webXml
- The webXml file to usefilterName
- The servlet namefilterClass
- The servlet class namepublic static void addContextParam(WebXml webXml, String name, String value)
webXml
- The webXml containing the descriptorname
- The context namevalue
- The context value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |