org.glassfish.jersey.server.model
Class ResourceModelValidator

java.lang.Object
  extended by org.glassfish.jersey.server.model.ResourceModelValidator
All Implemented Interfaces:
ResourceModelVisitor
Direct Known Subclasses:
BasicValidator

public abstract class ResourceModelValidator
extends Object
implements ResourceModelVisitor

An abstract resource model validator. This base resource model validator class implements the visitor pattern to traverse through all the resource model components to check validity of a resource model.

This validator maintains a list of all the issues found in the model. That way all the resource model components can be validated in a single call to the validate(...) method and collect all the validation issues from the model.

Author:
Jakub Podlesak (jakub.podlesak at oracle.com), Marek Potociar (marek.potociar at oracle.com)

Constructor Summary
ResourceModelValidator()
           
 
Method Summary
 void cleanIssueList()
          Removes all issues from the current issue list.
 boolean fatalIssuesFound()
          Convenience method to see if there were fatal issues found.
 List<ResourceModelIssue> getIssueList()
          Returns a list of issues found after validate(org.glassfish.jersey.server.model.ResourceModelComponent) method has been invoked.
 void validate(ResourceModelComponent component)
          The validate method validates a component and adds possible issues found to it's list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.glassfish.jersey.server.model.ResourceModelVisitor
visitInvocable, visitMethodHandler, visitResourceClass, visitResourceHandlerConstructor, visitResourceMethod
 

Constructor Detail

ResourceModelValidator

public ResourceModelValidator()
Method Detail

getIssueList

public List<ResourceModelIssue> getIssueList()
Returns a list of issues found after validate(org.glassfish.jersey.server.model.ResourceModelComponent) method has been invoked.

Returns:
a non-null list of issues.

fatalIssuesFound

public boolean fatalIssuesFound()
Convenience method to see if there were fatal issues found.

Returns:
true if there are any fatal issues present in the current issue list.

cleanIssueList

public void cleanIssueList()
Removes all issues from the current issue list. The method could be used to re-use the same ResourceModelValidator for another resource model.


validate

public void validate(ResourceModelComponent component)
The validate method validates a component and adds possible issues found to it's list. The list of issues could be then retrieved via getIssueList method.

Parameters:
component - resource model component.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.