org.eclipse.webdav.internal.kernel
Class ConditionTerm

java.lang.Object
  extended by org.eclipse.webdav.internal.kernel.ConditionTerm

public class ConditionTerm
extends Object

A ConditionTerm represents some state configuration of a resource that must be satisfied in order for the associated request to be valid. The ConditionFactors in a ConditionTerm must all match with states of the resource, i.e., they are AND'ed together. ConditionTerms are contained in a Condition which is used in the Precondition of a WebDAV If header.


Constructor Summary
ConditionTerm()
          Construct a Condition with no associated Resource URI.
 
Method Summary
 void addConditionFactor(ConditionFactor factor)
          Add a ConditionFactor to a ConditionTerm.
 boolean contains(ConditionFactor factor)
          Does this ConditionTerm contain the given ConditionFactor?
static ConditionTerm create(StreamTokenizer tokenizer)
          Create a ConditionTerm by parsing the given If header as defined by section 9.4 in the WebDAV spec.
 Enumeration getConditionFactors()
          Get all the ConditionFactors in this Condition.
 boolean matches(ConditionTerm conditionTerm)
          See if this ConditionTerm matches the given ConditionTerm.
 int numberOfFactors()
          Get the number of ConditionFactors in this ConditionTerm.
 String toString()
          Return a String representation of this ConditionTerm as defined by section 9.4 of the WebDAV Spec.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConditionTerm

public ConditionTerm()
Construct a Condition with no associated Resource URI.

Method Detail

addConditionFactor

public void addConditionFactor(ConditionFactor factor)
                        throws WebDAVException
Add a ConditionFactor to a ConditionTerm.

Parameters:
factor - the factor to add
Throws:
WebDAVException - thrown if the term already contains the factor

contains

public boolean contains(ConditionFactor factor)
Does this ConditionTerm contain the given ConditionFactor?

Parameters:
factor - the factor to check for
Returns:
true if the term contains the given factor

create

public static ConditionTerm create(StreamTokenizer tokenizer)
                            throws WebDAVException
Create a ConditionTerm by parsing the given If header as defined by section 9.4 in the WebDAV spec.

Parameters:
tokenizer - a StreamTokenizer on the contents of a WebDAV If header
Returns:
the parsed ConditionTerm
Throws:
WebDAVException - thrown if there is a syntax error in the If header

getConditionFactors

public Enumeration getConditionFactors()
Get all the ConditionFactors in this Condition. The ConditionFactors in a Condition must all match with states of the resource, i.e., they are AND'ed together. ConditionTerms are contained in a Condition which is used in the Precondition of a WebDAV If header.

Returns:
an Enumeration of ConditionFactors

matches

public boolean matches(ConditionTerm conditionTerm)
See if this ConditionTerm matches the given ConditionTerm. This is an AND operation. All the factors in the ConditionTerm must match.

Parameters:
conditionTerm - the term to match
Returns:
true if all the factors in the term match those in this term

numberOfFactors

public int numberOfFactors()
Get the number of ConditionFactors in this ConditionTerm.

Returns:
the number of factors in this term

toString

public String toString()
Return a String representation of this ConditionTerm as defined by section 9.4 of the WebDAV Spec.

Overrides:
toString in class Object
Returns:
a string representation of this term


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.