com.sun.jersey.server.impl.modelapi.validation
Class AbstractModelValidator

java.lang.Object
  extended by com.sun.jersey.server.impl.modelapi.validation.AbstractModelValidator
All Implemented Interfaces:
AbstractModelVisitor
Direct Known Subclasses:
BasicValidator

public abstract class AbstractModelValidator
extends java.lang.Object
implements AbstractModelVisitor

Abstract resource model validator allows to simply implement validators of resource model. A validator maintains a list of model issues found. User can call validate method to validate several resources by a single validator and collect issues.

Author:
Jakub.Podlesak@Sun.COM

Constructor Summary
AbstractModelValidator()
           
 
Method Summary
 void cleanIssueList()
          Removes all issues from the current issue list.
 boolean fatalIssuesFound()
          Convenience method to see if there were fatal issues found
 java.util.List<ResourceModelIssue> getIssueList()
          Returns a list of issues found after validate(com.sun.jersey.api.model.AbstractModelComponent) method has been invoked
 void validate(AbstractModelComponent 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 com.sun.jersey.api.model.AbstractModelVisitor
visitAbstractField, visitAbstractResource, visitAbstractResourceConstructor, visitAbstractResourceMethod, visitAbstractSetterMethod, visitAbstractSubResourceLocator, visitAbstractSubResourceMethod
 

Constructor Detail

AbstractModelValidator

public AbstractModelValidator()
Method Detail

getIssueList

public java.util.List<ResourceModelIssue> getIssueList()
Returns a list of issues found after validate(com.sun.jersey.api.model.AbstractModelComponent) 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 validator for another resource model


validate

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

Parameters:
resource -


Copyright © 2011 Sun Microsystems, Inc. All Rights Reserved.