xmltorng.i2s.impl
Class OptionalRepeatableElementPatternCategory
java.lang.Object
xmltorng.i2s.impl.RepeatableElementPatternCategory
xmltorng.i2s.impl.OptionalRepeatableElementPatternCategory
- All Implemented Interfaces:
- ChoicePatternCategory, PatternCategory
public final class OptionalRepeatableElementPatternCategory
- extends RepeatableElementPatternCategory
- implements ChoicePatternCategory
The OptionalRepeatableElementPatterncategory
is a pattern
category that contains optional or not optional choice patterns between
repeatable or not repeatable named elements.
It may also contain attributes and/or text.
It may not contain only the empty pattern.
Formally:
attribute ::=
attributes ::= attribute | ( attribute+ )
element ::= any
oneOrMoreElement ::= element | ( element )
| (choice> (element* & ( element )+) )
zerorOrMoreElement ::= oneOrMoreElement
| ( oneOrMoreElement )
zerorOrMoreElementAndText ::= zerorOrMoreElement
| ( zerorOrMoreElement )
content ::= zerorOrMoreElementAndText
| ( attributes zerorOrMoreElementAndText )
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OptionalRepeatableElementPatternCategory
public OptionalRepeatableElementPatternCategory()
OptionalRepeatableElementPatternCategory
public OptionalRepeatableElementPatternCategory(AttributesPatternCategory attributesPatternCategory,
boolean hasText)
OptionalRepeatableElementPatternCategory
public OptionalRepeatableElementPatternCategory(Name elementName,
boolean isRepeatable,
boolean isOptional)
setPatternOptional
public void setPatternOptional(boolean isOptional)
toString
public java.lang.String toString()
- Overrides:
toString
in class RepeatableElementPatternCategory
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
- Overrides:
fullPattern
in class RepeatableElementPatternCategory
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
- Overrides:
addPattern
in class RepeatableElementPatternCategory
isPatternOptional
public boolean isPatternOptional()
- Description copied from interface:
ChoicePatternCategory
- The returned value say if the element may be ommited or not.
- Specified by:
isPatternOptional
in interface ChoicePatternCategory
- Overrides:
isPatternOptional
in class RepeatableElementPatternCategory