de.knipp.rritoolkit
Class DefaultResponseFactory.KeyRule

java.lang.Object
  extended by de.knipp.rritoolkit.DefaultResponseFactory.ListRule
      extended by de.knipp.rritoolkit.DefaultResponseFactory.KeyRule
All Implemented Interfaces:
java.lang.Comparable<DefaultResponseFactory.ListRule>
Enclosing class:
DefaultResponseFactory

protected static class DefaultResponseFactory.KeyRule
extends DefaultResponseFactory.ListRule

rule that tests for the existance of certain keys

Version:
$Revision: 14936 $
Author:
Klaus Malorny

Field Summary
private  java.lang.String[] requiredKeys
          the keys that must appear in the list
 
Constructor Summary
DefaultResponseFactory.KeyRule(int thePriority, java.lang.Class<? extends Response> theClass, java.lang.String... keys)
          constructor
 
Method Summary
 boolean matches(org.w3c.dom.Document doc, Request request)
          test whether the rule matches
 boolean matches(KVMultiList list, Request request)
          test whether the rule matches
 
Methods inherited from class de.knipp.rritoolkit.DefaultResponseFactory.ListRule
compareTo, getResponseClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requiredKeys

private java.lang.String[] requiredKeys
the keys that must appear in the list

Constructor Detail

DefaultResponseFactory.KeyRule

public DefaultResponseFactory.KeyRule(int thePriority,
                                      java.lang.Class<? extends Response> theClass,
                                      java.lang.String... keys)
constructor

Parameters:
thePriority - the priority. The smaller the number, the earlier the rule is used.
theClass - the class that shall be instantiated
keys - the keys
Method Detail

matches

public boolean matches(KVMultiList list,
                       Request request)
test whether the rule matches

Specified by:
matches in class DefaultResponseFactory.ListRule
Parameters:
list - the list
request - the request, may be null
Returns:
true if the rule matches

matches

public boolean matches(org.w3c.dom.Document doc,
                       Request request)
test whether the rule matches

Specified by:
matches in class DefaultResponseFactory.ListRule
Parameters:
doc - the document
request - the request, may be null
Returns:
true if the rule matches


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH