com.caucho.relaxng.program
Class AttributeItem

java.lang.Object
  extended by com.caucho.relaxng.program.Item
      extended by com.caucho.relaxng.program.AttributeItem

public class AttributeItem
extends Item

Generates programs from patterns.


Field Summary
protected static L10N L
           
 
Fields inherited from class com.caucho.relaxng.program.Item
log
 
Constructor Summary
AttributeItem(NameClassItem name)
           
 
Method Summary
 boolean allowAttribute(QName name, java.lang.String value)
          Returns true if the attribute is allowed.
 boolean allowEmpty()
          The attribute does not allow the empty match.
 Item attributeEnd()
          Returns the item after the attribute ends.
 void attributeSet(java.util.HashSet<QName> set)
          Returns the attribute set, the set of attribute names possible.
 boolean equals(java.lang.Object o)
          Returns true if the object is an empty item.
 void firstSet(java.util.HashSet<QName> set)
          Returns the first set, the set of element names possible.
 NameClassItem getNameClassItem()
           
 int hashCode()
          Returns the hash code for the empty item.
protected  boolean isSimpleSyntax()
          Returns true for an element with simple syntax.
 Item setAttribute(QName name, java.lang.String value)
          Returns the next item on the match.
 java.lang.String toString()
           
 java.lang.String toSyntaxDescription(int depth)
          Returns the pretty printed syntax.
 
Methods inherited from class com.caucho.relaxng.program.Item
addSyntaxNewline, allowsElement, emptyItemIterator, endElement, error, getItemsIterator, groupContinuation, inElementContinuation, interleaveContinuation, itemIterator, requiredFirstSet, startElement, text
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

L

protected static final L10N L
Constructor Detail

AttributeItem

public AttributeItem(NameClassItem name)
Method Detail

getNameClassItem

public NameClassItem getNameClassItem()

firstSet

public void firstSet(java.util.HashSet<QName> set)
Returns the first set, the set of element names possible.

Overrides:
firstSet in class Item

allowEmpty

public boolean allowEmpty()
The attribute does not allow the empty match.

Overrides:
allowEmpty in class Item

attributeSet

public void attributeSet(java.util.HashSet<QName> set)
Returns the attribute set, the set of attribute names possible.

Overrides:
attributeSet in class Item

allowAttribute

public boolean allowAttribute(QName name,
                              java.lang.String value)
                       throws RelaxException
Returns true if the attribute is allowed.

Overrides:
allowAttribute in class Item
Parameters:
name - the name of the attribute
value - the value of the attribute
Returns:
the program for handling the element
Throws:
RelaxException

setAttribute

public Item setAttribute(QName name,
                         java.lang.String value)
                  throws RelaxException
Returns the next item on the match.

Overrides:
setAttribute in class Item
Parameters:
name - the name of the attribute
value - the value of the attribute
Returns:
the program for handling the element
Throws:
RelaxException

attributeEnd

public Item attributeEnd()
Returns the item after the attribute ends. In this case, return null since this attribute is still required.

Overrides:
attributeEnd in class Item

toSyntaxDescription

public java.lang.String toSyntaxDescription(int depth)
Returns the pretty printed syntax.

Overrides:
toSyntaxDescription in class Item

isSimpleSyntax

protected boolean isSimpleSyntax()
Returns true for an element with simple syntax.

Overrides:
isSimpleSyntax in class Item

hashCode

public int hashCode()
Returns the hash code for the empty item.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Returns true if the object is an empty item.

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object