de.knipp.rritoolkit
Class DefaultResponseFactory.ListRule

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

protected abstract static class DefaultResponseFactory.ListRule
extends java.lang.Object
implements java.lang.Comparable<DefaultResponseFactory.ListRule>

small class that describes a rule for choosing a specific subclass

Version:
$Revision: 14936 $
Author:
Klaus Malorny

Field Summary
private  java.lang.Class<? extends Response> cls
          the class that shall be instantiated
private  int priority
          the priority
 
Constructor Summary
DefaultResponseFactory.ListRule(int thePriority, java.lang.Class<? extends Response> theClass)
          constructor
 
Method Summary
 int compareTo(DefaultResponseFactory.ListRule other)
          compare this instance to another
 java.lang.Class<? extends Response> getResponseClass()
          return the class
abstract  boolean matches(org.w3c.dom.Document doc, Request request)
          test whether the rule matches
abstract  boolean matches(KVMultiList list, Request request)
          test whether the rule matches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

priority

private int priority
the priority


cls

private java.lang.Class<? extends Response> cls
the class that shall be instantiated

Constructor Detail

DefaultResponseFactory.ListRule

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

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

matches

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

Parameters:
list - the list
request - the request, may be null
Returns:
true if the rule matches

matches

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

Parameters:
doc - the document
request - the request, may be null
Returns:
true if the rule matches

getResponseClass

public java.lang.Class<? extends Response> getResponseClass()
return the class

Returns:
the class

compareTo

public int compareTo(DefaultResponseFactory.ListRule other)
compare this instance to another

Specified by:
compareTo in interface java.lang.Comparable<DefaultResponseFactory.ListRule>
Parameters:
other - the other object
Returns:
the result of the comparison


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH