sk.baka.ikslibs.ptr
Enum DomPointerFlag

java.lang.Object
  extended by java.lang.Enum<DomPointerFlag>
      extended by sk.baka.ikslibs.ptr.DomPointerFlag
All Implemented Interfaces:
Serializable, Comparable<DomPointerFlag>

public enum DomPointerFlag
extends Enum<DomPointerFlag>

Attributes for the DomPointer class.

Author:
Martin Vysny

Enum Constant Summary
NotEntityReference
          States that returned pointer must not have pointsTo containing an entity reference node.
NotIntoEntity
          If specified, then getNext and getPrevious can not return pointer having inEntity equal to true.
NotNullParentElement
          States that the pointer returned must not have parentElement null.
PointToAttr
           States that returned pointer must have DomPointer.pointsTo pointing to an attribute.
PointToContent
          States that the pointer must have DomPointer.pointsTo pointing to a regular element, a text/cdata node or an attribute node.
PointToElement
           States that returned pointer must have DomPointer.pointsTo pointing to a regular element.
PointToNode
          States that returned pointer must have pointsTo pointing to a non- null node.
PointToText
           States that returned pointer must have DomPointer.pointsTo pointing to a text (or cdata) node.
 
Method Summary
abstract  boolean complies(DomPointer ptr)
          Checks if given pointer complies the flag.
static boolean complies(DomPointer ptr, EnumSet<DomPointerFlag> flags)
          Checks if the pointer complies all defined flags (for behaviour when both PointToText and PointToElement flags are specified please see their specification).
static DomPointerFlag valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DomPointerFlag[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PointToNode

public static final DomPointerFlag PointToNode
States that returned pointer must have pointsTo pointing to a non- null node. Then, in pointsToId is id of this node.


PointToText

public static final DomPointerFlag PointToText

States that returned pointer must have DomPointer.pointsTo pointing to a text (or cdata) node. This flag implies the PointToNode flag.

Warning: It should not be used in combination with PointToElement or PointToAttr: no DOM pointer can point to text AND element at the same time.


PointToElement

public static final DomPointerFlag PointToElement

States that returned pointer must have DomPointer.pointsTo pointing to a regular element. This flag implies the PointToNode flag.

Warning: It should not be used in combination with PointToText or PointToAttr: no DOM pointer can point to text AND element at the same time.


PointToAttr

public static final DomPointerFlag PointToAttr

States that returned pointer must have DomPointer.pointsTo pointing to an attribute. This flag implies the PointToNode flag.

Warning: It should not be used in combination with PointToText or PointToElement: no DOM pointer can point to text AND attribute at the same time.

Note that the attribute is not part of the document structure and thus this kind of pointer is never returned by functions such as DomPointer.getNext(EnumSet, boolean, boolean, boolean) or DomPointer.getPrevious(EnumSet, boolean, boolean, boolean).


PointToContent

public static final DomPointerFlag PointToContent
States that the pointer must have DomPointer.pointsTo pointing to a regular element, a text/cdata node or an attribute node. In other words, pointer must comply PointToText OR PointToElement OR PointToAttr flags.


NotIntoEntity

public static final DomPointerFlag NotIntoEntity
If specified, then getNext and getPrevious can not return pointer having inEntity equal to true.


NotEntityReference

public static final DomPointerFlag NotEntityReference
States that returned pointer must not have pointsTo containing an entity reference node. This does not prevent getNext() and getPrevious() to go into entity contents if the IntoEntity is specified.


NotNullParentElement

public static final DomPointerFlag NotNullParentElement
States that the pointer returned must not have parentElement null.

Method Detail

values

public static final DomPointerFlag[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(DomPointerFlag c : DomPointerFlag.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static DomPointerFlag valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

complies

public abstract boolean complies(DomPointer ptr)
Checks if given pointer complies the flag.

Parameters:
ptr - pointer to check.
Returns:
true if the pointer complies to the flag, false otherwise.

complies

public static boolean complies(DomPointer ptr,
                               EnumSet<DomPointerFlag> flags)
Checks if the pointer complies all defined flags (for behaviour when both PointToText and PointToElement flags are specified please see their specification).

Parameters:
ptr - pointer to check
flags - set of flags
Returns:
true if the pointer complies all flags.


Copyright © 2006 Martin Vysny - baka. All Rights Reserved.