public class WebXmlMerger extends LoggedObject
Modifier and Type | Class and Description |
---|---|
protected static interface |
WebXmlMerger.IMergeImplementation
Interface used as a callback for descriptors.
|
Modifier and Type | Field and Description |
---|---|
protected MergeStrategy |
mergeContextParamsStrategy
Strategy for merging context parameters.
|
protected MergeStrategy |
mergeListenerStrategy
Strategy for merging listeners.
|
Constructor and Description |
---|
WebXmlMerger(WebXml theWebXml)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkServletVersions(WebXml theWebXml)
Checks the versions of the servlet API in each descriptor, and logs a warning if a mismatch
might result in the loss of definitions.
|
protected VendorWebAppDescriptor |
getVendorWebAppDescriptor(WebXml theWebXml,
Class clazz)
Get the vendor web app descriptor out of the web xml.
|
void |
merge(WebXml theMergeWebXml)
Merges the merge descriptor with the original descriptor.
|
protected void |
mergeContextParams(WebXml theWebXml)
Merges the context-param definitions from the specified descriptor into the original
descriptor.
|
protected void |
mergeEjbLocalRefs(WebXml theWebXml)
Merges the EJB local references from the provided descriptor into the original descriptor.
|
protected void |
mergeEjbRefs(WebXml theWebXml)
Merges the EJB references from the provided descriptor into the original descriptor.
|
protected void |
mergeEnvironmentEntries(WebXml theWebXml)
Merges the environment entries from the provided descriptor into the original descriptor.
|
protected void |
mergeFilters(WebXml theWebXml)
Merges the servlet definitions from the specified descriptor into the original descriptor.
|
protected void |
mergeListeners(WebXml theWebXml)
Merges the listener elements from the provided descriptor into the original
descriptor.
|
protected void |
mergeLoginConfig(WebXml theWebXml)
Merges the login configuration from the provided descriptor into the original descriptor,
thereby eventually replacing the existing login config.
|
protected void |
mergeResourceEnvironmentReferences(WebXml theWebXml)
Merges the resource environment references from the provided descriptor into the original
descriptor.
|
protected void |
mergeResourceReferences(WebXml theWebXml)
Merges the resource references from the provided descriptor into the original descriptor.
|
protected void |
mergeSecurityConstraints(WebXml theWebXml) |
protected void |
mergeSecurityRoles(WebXml theWebXml)
Merges the security roles from the provided descriptor into the original descriptor.
|
protected void |
mergeServlets(WebXml theWebXml)
Merges the servlet definitions from the specified descriptor into the original descriptor.
|
protected void |
mergeVendorDescriptors(WebXml theWebXml)
Merge in any vendor specific descriptors.
|
protected void |
mergeVendorDescriptors(WebXml theWebXml,
Class clazz,
WebXmlMerger.IMergeImplementation merger)
Find vendor descriptors of a specific class, and merge them if they exist.
|
void |
setMergeContextParamsStrategy(MergeStrategy ms)
Set the merging strategy for context-param nodes.
|
getLogger, setLogger
protected MergeStrategy mergeContextParamsStrategy
protected MergeStrategy mergeListenerStrategy
public WebXmlMerger(WebXml theWebXml)
theWebXml
- The original descriptorpublic void setMergeContextParamsStrategy(MergeStrategy ms)
ms
- in the merging strategypublic final void merge(WebXml theMergeWebXml)
theMergeWebXml
- The descriptor to merge inprotected final void mergeVendorDescriptors(WebXml theWebXml)
theWebXml
- xml to merge inprotected final void mergeVendorDescriptors(WebXml theWebXml, Class clazz, WebXmlMerger.IMergeImplementation merger)
theWebXml
- in the web xml to be mergedclazz
- in the class of vendor webxml to mergemerger
- in the callback class that does the mergingprotected VendorWebAppDescriptor getVendorWebAppDescriptor(WebXml theWebXml, Class clazz)
theWebXml
- in the web xmlclazz
- the class of vendor descriptorprotected final void checkServletVersions(WebXml theWebXml)
theWebXml
- The descriptor that will be merged with the originalprotected final void mergeContextParams(WebXml theWebXml) throws MergeException
theWebXml
- The descriptor that contains the context-params definitions that are to be
merged into the original descriptorMergeException
- if there is a problem performing the mergeprotected final void mergeFilters(WebXml theWebXml)
theWebXml
- The descriptor that contains the filter definitions that are to be merged
into the original descriptorprotected final void mergeServlets(WebXml theWebXml)
theWebXml
- The descriptor that contains the servlet definitions that are to be merged
into the original descriptorprotected final void mergeListeners(WebXml theWebXml)
theWebXml
- The descriptor that contains the references that are to be merged into the
original descriptorprotected final void mergeResourceEnvironmentReferences(WebXml theWebXml)
theWebXml
- The descriptor that contains the references that are to be merged into the
original descriptorprotected final void mergeResourceReferences(WebXml theWebXml)
theWebXml
- The descriptor that contains the resource refs that are to be merged into
the original descriptorprotected final void mergeSecurityConstraints(WebXml theWebXml)
theWebXml
- The descriptor that contains the security constraints that are to be merged
into the original descriptorprotected final void mergeLoginConfig(WebXml theWebXml)
theWebXml
- The descriptor that contains the login config that is to be merged into the
original descriptorprotected final void mergeSecurityRoles(WebXml theWebXml)
theWebXml
- The descriptor that contains the security roles that are to be merged into
the original descriptorprotected final void mergeEnvironmentEntries(WebXml theWebXml)
theWebXml
- The descriptor that contains the environment entries that are to be merged
into the original descriptorprotected final void mergeEjbRefs(WebXml theWebXml)
theWebXml
- The descriptor that contains the EJB refs that are to be merged into the
original descriptorprotected final void mergeEjbLocalRefs(WebXml theWebXml)
theWebXml
- The descriptor that contains the EJB local refs that are to be merged into
the original descriptorCopyright © 2004-2013 Codehaus. All Rights Reserved.