xmltorng.i2s.impl
Class ElementPatternCategory

java.lang.Object
  extended by xmltorng.i2s.impl.ElementPatternCategory
All Implemented Interfaces:
PatternCategory

public final class ElementPatternCategory
extends java.lang.Object
implements PatternCategory

A pattern category for content with one element. May also contain attributes. formally: attribute ::= attributes ::= attribute | ( attribute+ ) element ::= any oneElement ::= element | element+ content ::= oneElement | ( attributes oneElement )


Constructor Summary
ElementPatternCategory(Name elementName)
           
 
Method Summary
 void addElementName(Name elementName)
           
 boolean addPattern(Name[] attributeNames, boolean hasText, RepeatableName[] repeatableElementNames)
          Add a pattern to this pattern category.
 AttributesPatternCategory attributesPatternCategory()
           
 Pattern fullPattern(java.util.Map fromNameToElementDefinition)
          Return a pattern that meets all the entered patterns.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementPatternCategory

public ElementPatternCategory(Name elementName)
Method Detail

addElementName

public final void addElementName(Name elementName)

attributesPatternCategory

public AttributesPatternCategory attributesPatternCategory()

fullPattern

public Pattern fullPattern(java.util.Map fromNameToElementDefinition)
Description copied from interface: PatternCategory
Return a pattern that meets all the entered patterns. May fail, then return null. If successfull then may use and update the given map between element name and element definition.

Specified by:
fullPattern in interface PatternCategory

addPattern

public boolean addPattern(Name[] attributeNames,
                          boolean hasText,
                          RepeatableName[] repeatableElementNames)
Description copied from interface: PatternCategory
Add a pattern to this pattern category. The pattern is given as a text presence flag, an attribute name set and an element name sequence, where each element may or may not be repeated. Returns true in case of success or if the pattern category already includes the pattern. Returns false if the pattern is out of the pattern category but the pattern category might be affected in that case too.

Specified by:
addPattern in interface PatternCategory