xmltorng.i2s.impl
Class ElementPatternCategory
java.lang.Object
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 )
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ElementPatternCategory
public ElementPatternCategory(Name elementName)
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