|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.j2ee.WarValidator
A task to validate a war file. The following is checked:
<servlet> tag are loadable
from the war file and not the classpath
<servlet> tag exist in the war
<taglib>
have a
<taglib-location>
that exists in the war<location>
nested
within an <error-page>
element must exist in the
war file<form-login-config
>
element must exist in the war file
Constructor Summary | |
WarValidator()
Creates a new instance of WarValidator |
Method Summary | |
void |
addFormatter(ValidationFormatter formatter)
Add a formatter to pick up events and display the output. |
void |
addValidationListener(ValidationListener listener)
add a listener to the list to be notified |
protected void |
endValidation()
End validation - fire an ended event |
protected void |
error(String message)
Helper method to fire an error message using the broadcaster |
void |
execute()
Perform the validation. |
protected ValidationBroadcaster |
getBroadcaster()
Getter for property broadcaster. |
ValidationStatusListener |
getStatus()
Provides access to the status listener that is automatically attached to the validation |
String |
getWarFileName()
Getter for property warFileName. |
protected void |
info(String message)
Helper method to fire an information message using the broadcaster |
boolean |
isFailOnError()
Whether the build process will fail if a validation error occurs. |
void |
removeValidationListener(ValidationListener listener)
remove a listener from the list to be notified |
void |
setFailOnError(boolean failOnError)
Set whether the build process will fail if a validation error occurs. |
void |
setWarFileName(String warFileName)
Setter for property warFileName. |
protected void |
startValidation()
Start validation - issue a started event, and check the war file is ok from a filesystem perspective - exists and is readable |
String |
toString()
Provide a string representation of the validator |
void |
validate()
validate the provided war file |
protected void |
validateClass(String className,
ClassLoader loader)
Validate that the given className can be loaded by the given ClasssLoader |
void |
validateErrorPages(WarFile war)
Validate the error pages defined in the war file (as defined by a <error-page> tag in web.xml), making sure that the
location specifed by the nested <location> exists in
the war file |
void |
validateFormLoginConfig(WarFile war)
Validate that the <form-login-config> element, if it
exists contains valid login and error pages |
protected void |
validateWarContents()
Hook point for subclasses to add validations |
protected void |
warning(String message)
Helper method to fire a warning message using the broadcaster |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public WarValidator()
Method Detail |
public ValidationStatusListener getStatus()
public void execute()
IllegalStateException
- when any error occurspublic void validate()
protected void startValidation()
protected void validateWarContents()
protected void endValidation()
protected void validateClass(String className, ClassLoader loader)
ClasssLoader
className
- the name of a class to attempt loadingloader
- a class loader
public void validateErrorPages(WarFile war) throws IOException
<error-page>
tag in web.xml), making sure that the
location specifed by the nested <location>
exists in
the war file
war
- the war file to validate
IOException
- when there are any issues reading the war filepublic void validateFormLoginConfig(WarFile war) throws IOException
<form-login-config>
element, if it
exists contains valid login and error pages
war
- the war file to validate
IOException
- when there are any issues reading the war filepublic void addValidationListener(ValidationListener listener)
listener
- a ValidationListener
public void removeValidationListener(ValidationListener listener)
listener
- a ValidationListener
public String getWarFileName()
public void setWarFileName(String warFileName)
warFileName
- New value of property warFileName.protected ValidationBroadcaster getBroadcaster()
public void addFormatter(ValidationFormatter formatter)
formatter
- a class to format validation eventspublic String toString()
public boolean isFailOnError()
public void setFailOnError(boolean failOnError)
failOnError
- New value of property failOnError.protected void info(String message)
message
- to be firedprotected void error(String message)
message
- to be firedprotected void warning(String message)
message
- to be fired
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |