com.caucho.relaxng.program
Class InElementItem

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

public class InElementItem
extends Item

Represents a match inside an element with a continuation. In the following example, the "c, d" would be eltItem and "e" would be the contItem.

a { b . c, d } e


Field Summary
protected static L10N L
           
 
Fields inherited from class com.caucho.relaxng.program.Item
log
 
Method Summary
 boolean allowAttribute(QName name, java.lang.String value)
          Sets an attribute.
 boolean allowEmpty()
          Allows empty if both allow empty.
 boolean allowsElement(QName name)
          Returns true if the element is allowed somewhere in the item.
 Item attributeEnd()
          Returns true if the element is allowed to end here.
 void attributeSet(java.util.HashSet<QName> set)
          Returns the first set, the set of attribute names possible.
static InElementItem create(Item eltItem, Item contItem)
           
 Item endElement()
          Returns the next item when the element is completes.
 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.
 Item getContinuationItem()
           
 Item getElementItem()
           
 Item getFirst()
           
 java.util.Iterator<Item> getItemsIterator()
          Return all possible child items or null
 Item getSecond()
           
 Item groupContinuation(Item cont)
          Adds a continuation
 int hashCode()
          Returns the hash code for the empty item.
 Item inElementContinuation(Item cont)
          Adds a continuation
 Item interleaveContinuation(Item cont)
          Interleaves a continuation.
 boolean isSimpleSyntax()
          Returns true if the syntax description is simple
 void requiredFirstSet(java.util.HashSet<QName> set)
          Returns the first set, the set of element names possible.
 Item setAttribute(QName name, java.lang.String value)
          Sets an attribute.
 Item startElement(QName name)
          Returns the next item when an element of the given name is returned
 Item text(java.lang.CharSequence string)
          Returns the next item when some text data is available.
 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, emptyItemIterator, error, itemIterator
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

L

protected static final L10N L
Method Detail

create

public static InElementItem create(Item eltItem,
                                   Item contItem)

getFirst

public Item getFirst()

getSecond

public Item getSecond()

getElementItem

public Item getElementItem()

getContinuationItem

public Item getContinuationItem()

interleaveContinuation

public Item interleaveContinuation(Item cont)
Interleaves a continuation.

Overrides:
interleaveContinuation in class Item

inElementContinuation

public Item inElementContinuation(Item cont)
Adds a continuation

Overrides:
inElementContinuation in class Item

groupContinuation

public Item groupContinuation(Item cont)
Adds a continuation

Overrides:
groupContinuation in class 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()
Allows empty if both allow empty.

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 when an element of the given name is returned

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

text

public Item text(java.lang.CharSequence string)
          throws RelaxException
Returns the next item when some text data is available.

Overrides:
text in class Item
Parameters:
string - the text data
Returns:
the program for handling the element
Throws:
RelaxException

attributeSet

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

Overrides:
attributeSet in class Item

allowAttribute

public boolean allowAttribute(QName name,
                              java.lang.String value)
                       throws RelaxException
Sets an attribute.

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
Sets an attribute.

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 true if the element is allowed to end here.

Overrides:
attributeEnd in class Item

endElement

public Item endElement()
                throws RelaxException
Returns the next item when the element is completes.

Overrides:
endElement in class Item
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

public boolean isSimpleSyntax()
Returns true if the syntax description is simple

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