com.caucho.relaxng.program
Class ElementItem

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

public class ElementItem
extends Item

Generates programs from patterns.


Field Summary
protected static L10N L
           
 
Fields inherited from class com.caucho.relaxng.program.Item
log
 
Constructor Summary
ElementItem(ElementPattern element, NameClassItem nameItem)
           
 
Method Summary
 boolean allowEmpty()
          The element does not allow the empty match.
 boolean allowsElement(QName name)
          Returns true if the element is allowed somewhere in the item.
 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.
 java.util.Iterator<Item> getItemsIterator()
          Return all possible child items or null
 NameClassItem getNameClassItem()
           
 int hashCode()
          Returns the hash code for the empty item.
protected  boolean isSimpleSyntax()
          Returns true for an element with simple syntax.
 void requiredFirstSet(java.util.HashSet<QName> set)
          Returns the first set, the set of element names possible.
 void setChildrenItem(Item item)
           
 Item startElement(QName name)
          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, allowAttribute, attributeEnd, attributeSet, emptyItemIterator, endElement, error, groupContinuation, inElementContinuation, interleaveContinuation, itemIterator, setAttribute, 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

ElementItem

public ElementItem(ElementPattern element,
                   NameClassItem nameItem)
Method Detail

getNameClassItem

public NameClassItem getNameClassItem()

setChildrenItem

public void setChildrenItem(Item item)

firstSet

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

Overrides:
firstSet in class Item

requiredFirstSet

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

Overrides:
requiredFirstSet in class Item

allowEmpty

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

Overrides:
allowEmpty in class Item

getItemsIterator

public java.util.Iterator<Item> getItemsIterator()
Return all possible child items or null

Overrides:
getItemsIterator in class Item

startElement

public Item startElement(QName name)
                  throws RelaxException
Returns the next item on the match.

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

allowsElement

public boolean allowsElement(QName name)
Returns true if the element is allowed somewhere in the item. allowsElement is used for error messages to give more information in cases of order dependency.

Overrides:
allowsElement in class Item
Parameters:
name - the name of the element
Returns:
true if the element is allowed somewhere

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