Package eu.bandm.tools.option.absy
Class Element_option
java.lang.Object
eu.bandm.tools.tdom.runtime.TypedNode<X>
eu.bandm.tools.tdom.runtime.TypedSubstantial<X>
eu.bandm.tools.tdom.runtime.TypedElement<Element,Extension>
eu.bandm.tools.option.absy.Element
eu.bandm.tools.option.absy.Element_option
- All Implemented Interfaces:
Locatable<XMLDocumentIdentifier>
,Matchable<BaseMatcher>
,TypedContent
,Visitable<Visitor>
@Undocumented
public class Element_option
extends Element
implements Visitable<Visitor>, Matchable<BaseMatcher>
Meaning: Definition of one particular option
as it appears on a command line,
in the GUI, etc. At least one of
@name
or @abbrev
must be
given!. <!ELEMENT option ((noGui)?, (isMeta)?, desc, type, (condition)?) >.
Optional attributes:
name
, abbrev
, required
.
This class realizes the element definition from the source DTD.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Meaning: the short name, entered in the commandline with one minus sign, like "-h
".static class
Meaning: the long name, entered in the commandline with two minus signs, like "--help
".static class
Meaning: Says whether this option must be present on the command line.Nested classes/interfaces inherited from class eu.bandm.tools.option.absy.Element
Element.UnmixedContent
Nested classes/interfaces inherited from class eu.bandm.tools.tdom.runtime.TypedElement
TypedElement.AttributeDecoder, TypedElement.AttributeEncoder, TypedElement.MixedContent<E extends TypedElement<E,
X>, X extends TypedExtension>, TypedElement.MixedContentContainer, TypedElement.MixedContentFactory<C extends TypedElement.MixedContent<E, X>, E extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception>, TypedElement.PCDataContainer Nested classes/interfaces inherited from class eu.bandm.tools.tdom.runtime.TypedNode
TypedNode.ParseListener<E extends TypedElement<?,
?>> Nested classes/interfaces inherited from interface eu.bandm.tools.tdom.runtime.TypedContent
TypedContent.DecodingConstructor<C extends TypedContent,
X extends TypedExtension, Y extends Exception>, TypedContent.ParsingConstructor<C extends TypedContent, E extends TypedElement<E, X>, X extends TypedExtension, Y extends Exception> -
Field Summary
Modifier and TypeFieldDescription(package private) Element_condition
(package private) Element_desc
(package private) Element_isMeta
(package private) Element_noGui
(package private) Element_type
(package private) static final String
static final NamespaceName
Name of the Element is in namespace-enabled mode, namely{http://bandm.eu/doctypes/option}option
.static final String
(package private) static final String
static final int
static final String
The name of the element, as it appears literally in the underlying DTD.Fields inherited from class eu.bandm.tools.option.absy.Element
decodeTable, parseTable
Fields inherited from class eu.bandm.tools.tdom.runtime.TypedElement
getDeepPCData, getFlatPCData
-
Constructor Summary
ConstructorDescriptionElement_option
(Element_noGui elem_1_noGui, Element_isMeta elem_1_isMeta, Element_desc elem_1_desc, Element_type elem_1_type, Element_condition elem_1_condition) Statically typed w.r.t. the contents, as far as possible.Element_option
(Element... content) Semi-parsing constructor which tries to parse sequences of model elements.Element_option
(ContentMapping content, Extension ext, TypedNode.ParseListener<Element> listener) Element_option
(TypedAttribute.SafeValues flag, Element_noGui elem_1_noGui, Element_isMeta elem_1_isMeta, Element_desc elem_1_desc, Element_type elem_1_type, Element_condition elem_1_condition) Element_option
(Attributes attrs, Element... content) Semi-parsing constructor which tries to parse sequences of model content. -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected TypedAttribute[]
final Element_option
(package private) static Element_option
decode
(DecodingInputStream in, Extension ext) final void
encode
(EncodingOutputStream out, Extension ext) Abstract fall-back method which MUST be overridden and always throws an Exception.Meaning: the short name, entered in the commandline with one minus sign, like "-h
".final Element_option.Attr_name
Meaning: the long name, entered in the commandline with two minus signs, like "--help
".Meaning: Says whether this option must be present on the command line.(package private) static TypedContent.DecodingConstructor<? extends Element_option,
Extension, TdomAttributeException> static TypedDTD.ElementInfo
Give reflexive info object about the generated class.(package private) static TypedContent.ParsingConstructor<? extends Element_option,
Element, Extension, TdomAttributeException> final int
boolean
boolean
boolean
void
Send the visitor to this instance.void
identify
(BaseMatcher matcher) protected void
protected void
initAttrs
(Attributes attrs) Pick attribute values from the argument and copy them to the attribute values of this element.protected void
(package private) static boolean
lookahead
(Iterators.MultipleLookaheadIterator<? extends Element> i, boolean optional) (package private) static boolean
lookahead
(SAXEventStream in, Extension ext, boolean optional) (package private) static Element_option
parse
(ContentMapping content, Extension ext, TypedNode.ParseListener<Element> listener) static Element_option
parse
(SAXEventStream in, Extension ext, TypedNode.ParseListener<Element> listener) (package private) static Element_option
parse
(Element domElement, Extension ext, TypedNode.ParseListener<Element> listener) (package private) static Element_option
parseOptional
(SAXEventStream in, Extension ext, TypedNode.ParseListener<Element> listener) (package private) static Element_option[]
parsePlus
(SAXEventStream in, Extension ext, TypedNode.ParseListener<Element> listener) (package private) static Element_option[]
parseStar
(SAXEventStream in, Extension ext, TypedNode.ParseListener<Element> listener) Meaning: the short name, entered in the commandline with one minus sign, like "-h
".final Element_option.Attr_name
Meaning: the long name, entered in the commandline with two minus signs, like "--help
".Meaning: Says whether this option must be present on the command line.(package private) static Element_option
semiparse
(Iterators.MultipleLookaheadIterator<? extends Element> i) (package private) static @Opt Element_option
semiparseOptional
(Iterators.MultipleLookaheadIterator<? extends Element> i) (package private) static Element_option[]
semiparsePlus
(Iterators.MultipleLookaheadIterator<? extends Element> i) (package private) static Element_option[]
semiparseStar
(Iterators.MultipleLookaheadIterator<? extends Element> i) void
set
(Element_noGui elem_1_noGui, Element_isMeta elem_1_isMeta, Element_desc elem_1_desc, Element_type elem_1_type, Element_condition elem_1_condition) Set all contents fields to a new value, after checking.setElem_1_condition
(@Opt Element_condition newElem_1_condition) setElem_1_desc
(Element_desc newElem_1_desc) setElem_1_isMeta
(@Opt Element_isMeta newElem_1_isMeta) setElem_1_noGui
(@Opt Element_noGui newElem_1_noGui) setElem_1_type
(Element_type newElem_1_type) Methods inherited from class eu.bandm.tools.option.absy.Element
getDeepPCData
Methods inherited from class eu.bandm.tools.tdom.runtime.TypedElement
classifyForException, decodeMixed, decodeOptional, decodePlus, decodePlusList, decodeStar, decodeStarList, encode, encodeMixed, end, ensureSize, extractElement, getAttrsSnapshot, getAttrsSnapshot, getElemsSnapshot, getEtherealContainer, getLocalName, getName, getNamespaceURI, getPCData, getTagName, initAttrs, initAttrsSafe, matchEndElement, matchEndElement, matchStartElement, matchStartElement, parseAbstract, parseAndClose, parseAndClose, parseMixed, parseMixed, parseOptional, parsePlus, parsePlusList, parseStar, parseStarList, semiparseEmpty, semiparseMixed, setResizing, start, w3c_getNamespaceName
Methods inherited from class eu.bandm.tools.tdom.runtime.TypedSubstantial
dumpFollowingEthereals, dumpPrecedingEthereals, getFollowingEthereals, getPrecedingEthereals, readFollowingEthereals, readPrecedingEthereals
Methods inherited from class eu.bandm.tools.tdom.runtime.TypedNode
asBigDecimal, asBigDecimal, asBigDecimal, asBigDecimal, asBigInteger, asBigInteger, asBigInteger, asBigInteger, asBoolean, asBoolean, asDouble, asDouble, asDouble, asDouble, asFloat, asFloat, asFloat, asFloat, asHexInt, asHexInt, asHexInt, asHexInt, asInt, asInt, asInt, asInt, asLong, asLong, asLong, asLong, asTrimmedString, asTrimmedString, asTrimmedString, asTrimmedString, checkPlus, checkPlus, checkStar, checkStar, checkStrict, encodeOptional, encodePlus, encodePlus, encodeStar, encodeStar, extractEthereals, getLocation, getPCData, setLocation, setLocation, setLocation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.bandm.tools.location.Locatable
getLocation
-
Field Details
-
TAG_INDEX
public static final int TAG_INDEX- See Also:
-
elem_1_noGui
Element_noGui elem_1_noGui -
elem_1_isMeta
Element_isMeta elem_1_isMeta -
elem_1_desc
Element_desc elem_1_desc -
elem_1_type
Element_type elem_1_type -
elem_1_condition
Element_condition elem_1_condition -
TAG_NAME
The name of the element, as it appears literally in the underlying DTD.- See Also:
-
namespaceURI
- See Also:
-
prefix
- See Also:
-
localName
- See Also:
-
name
Name of the Element is in namespace-enabled mode, namely{http://bandm.eu/doctypes/option}option
.
-
-
Constructor Details
-
Element_option
@Undocumented public Element_option(Element_noGui elem_1_noGui, Element_isMeta elem_1_isMeta, Element_desc elem_1_desc, Element_type elem_1_type, Element_condition elem_1_condition) throws TdomAttributeSyntaxException Statically typed w.r.t. the contents, as far as possible. So aTdomContentException
can not occur.
The user MAY define a subclass (mostly an anonymous one, on the fly) and overrideinitAttrs()
to set the values for the optional attributes.- Throws:
IllegalArgumentException
- if any input to contents is null, except where explicitly allowed by(..)?
in the content model.TdomAttributeSyntaxException
-
Element_option
Element_option(ContentMapping content, Extension ext, TypedNode.ParseListener<Element> listener) throws TdomAttributeException, TdomAttributeSyntaxException, TdomContentException -
Element_option
public Element_option(TypedAttribute.SafeValues flag, Element_noGui elem_1_noGui, Element_isMeta elem_1_isMeta, Element_desc elem_1_desc, Element_type elem_1_type, Element_condition elem_1_condition) -
Element_option
@SafeVarargs @Undocumented public Element_option(@Opt Attributes attrs, Element... content) throws TdomAttributeSyntaxException, TdomContentException Semi-parsing constructor which tries to parse sequences of model content. Dynamically typed.- Parameters:
attrs
- (maybe null) A SAX auxiliary attribute store, from which values for the attributes defined for this element will be picked. (Undefined attributes are ignored; a value of null leaves the attribute default values untouched; all attribute values can be overridden by overridinginitAttrs()
, which is called after this picking.)content
- the Element sequence to parse.- Throws:
TdomContentException
- if the sequence in 'contents' does not match the content model.IllegalArgumentException
- if any input to contents is null, except where explicitly allowed by(..)?
in the content model.TdomAttributeSyntaxException
-
Element_option
@SafeVarargs @Undocumented public Element_option(Element... content) throws TdomAttributeSyntaxException, TdomContentException Semi-parsing constructor which tries to parse sequences of model elements. Dynamically typed.
The user MAY define a subclass (mostly an anonymous one, on the fly) and overrideinitAttrs()
to set the values for the optional attributes.- Parameters:
content
- the Element sequence to parse.- Throws:
TdomContentException
- if the sequence in 'contents' does not match the content model.IllegalArgumentException
- if any input to contents is null, except where explicitly allowed by(..)?
in the content model.TdomAttributeSyntaxException
-
-
Method Details
-
set
@Undocumented public void set(Element_noGui elem_1_noGui, Element_isMeta elem_1_isMeta, Element_desc elem_1_desc, Element_type elem_1_type, Element_condition elem_1_condition) Set all contents fields to a new value, after checking. Statically typed, as far as possible. So aTdomContentException
can not occur.
(Values of Attributes are not affected.)- Throws:
IllegalArgumentException
- if any input to contents is null, except where explicitly allowed by(..)?
in the content model.
-
encode
Description copied from class:TypedNode
Abstract fall-back method which MUST be overridden and always throws an Exception.- Specified by:
encode
in classTypedNode<Extension>
- Throws:
IOException
-
decode
static Element_option decode(DecodingInputStream in, Extension ext) throws TdomAttributeException, IOException, TdomContentException -
__dumpElementSnapshot
- Specified by:
__dumpElementSnapshot
in classTypedElement<Element,
Extension>
-
getTagIndex
public final int getTagIndex()- Specified by:
getTagIndex
in classTypedElement<Element,
Extension>
-
getAttr_name
Meaning: the long name, entered in the commandline with two minus signs, like "--help
". Must have more than one character.- Returns:
- an implementation of that Attribute, the value of which can be
read and written.
(If only read access is needed,readAttr_name()
should be used.)
-
readAttr_name
Meaning: the long name, entered in the commandline with two minus signs, like "--help
". Must have more than one character.- Returns:
- an implementation of that Attribute, the value of which can be
read, but is not guaranteed to be writable.
(If write access is needed,getAttr_name()
must be used.)
-
getAttr_abbrev
Meaning: the short name, entered in the commandline with one minus sign, like "-h
". Must have exactly one character.- Returns:
- an implementation of that Attribute, the value of which can be
read and written.
(If only read access is needed,readAttr_abbrev()
should be used.)
-
readAttr_abbrev
Meaning: the short name, entered in the commandline with one minus sign, like "-h
". Must have exactly one character.- Returns:
- an implementation of that Attribute, the value of which can be
read, but is not guaranteed to be writable.
(If write access is needed,getAttr_abbrev()
must be used.)
-
getAttr_required
Meaning: Says whether this option must be present on the command line. Is used to synthesize checking code.- Returns:
- an implementation of that Attribute, the value of which can be
read and written.
(If only read access is needed,readAttr_required()
should be used.)
-
readAttr_required
Meaning: Says whether this option must be present on the command line. Is used to synthesize checking code.- Returns:
- an implementation of that Attribute, the value of which can be
read, but is not guaranteed to be writable.
(If write access is needed,getAttr_required()
must be used.)
-
__getAllAttrs
- Overrides:
__getAllAttrs
in classTypedElement<Element,
Extension>
-
hasElem_1_noGui
- Returns:
- whether the 1st appearance of
Element_noGui
in the content model of this is not set tonull
-
getElem_1_noGui
- Returns:
- (maybe null) the current value of the 1st appearance of
Element_noGui
in the content model of this.
-
setElem_1_noGui
- Parameters:
newElem_1_noGui
- (maybe null) new value for the 1st appearance ofElement_noGui
in the content model of this.- Returns:
- (maybe null) the overwritten value.
-
hasElem_1_isMeta
- Returns:
- whether the 1st appearance of
Element_isMeta
in the content model of this is not set tonull
-
getElem_1_isMeta
- Returns:
- (maybe null) the current value of the 1st appearance of
Element_isMeta
in the content model of this.
-
setElem_1_isMeta
- Parameters:
newElem_1_isMeta
- (maybe null) new value for the 1st appearance ofElement_isMeta
in the content model of this.- Returns:
- (maybe null) the overwritten value.
-
getElem_1_desc
- Returns:
- (never null) the current value of the 1st appearance of
Element_desc
in the content model of this.
-
setElem_1_desc
- Parameters:
newElem_1_desc
- (never null) new value for the 1st appearance ofElement_desc
in the content model of this.- Returns:
- (never null) the overwritten value.
- Throws:
IllegalArgumentException
- in case of null.
-
getElem_1_type
- Returns:
- (never null) the current value of the 1st appearance of
Element_type
in the content model of this.
-
setElem_1_type
- Parameters:
newElem_1_type
- (never null) new value for the 1st appearance ofElement_type
in the content model of this.- Returns:
- (never null) the overwritten value.
- Throws:
IllegalArgumentException
- in case of null.
-
hasElem_1_condition
- Returns:
- whether the 1st appearance of
Element_condition
in the content model of this is not set tonull
-
getElem_1_condition
- Returns:
- (maybe null) the current value of the 1st appearance of
Element_condition
in the content model of this.
-
setElem_1_condition
@Undocumented public Element_condition setElem_1_condition(@Opt @Opt Element_condition newElem_1_condition) - Parameters:
newElem_1_condition
- (maybe null) new value for the 1st appearance ofElement_condition
in the content model of this.- Returns:
- (maybe null) the overwritten value.
-
parse
static Element_option parse(Element domElement, Extension ext, TypedNode.ParseListener<Element> listener) throws TdomAttributeException, TdomContentException -
parse
static Element_option parse(ContentMapping content, Extension ext, TypedNode.ParseListener<Element> listener) throws TdomAttributeException, TdomContentException -
getParseClosure
static TypedContent.ParsingConstructor<? extends Element_option,Element, getParseClosure()Extension, TdomAttributeException> -
getDecodeClosure
static TypedContent.DecodingConstructor<? extends Element_option,Extension, getDecodeClosure()TdomAttributeException> -
initAttrs
Pick attribute values from the argument and copy them to the attribute values of this element. Will be called on constructor operation before the explicit override ininitAttrs()
.- Overrides:
initAttrs
in classTypedElement<Element,
Extension> - Parameters:
attrs
- collection of (possibly superfluous, undeclared) SAX encoded attribute values.- Throws:
TdomAttributeSyntaxException
-
parseStar
static Element_option[] parseStar(SAXEventStream in, Extension ext, TypedNode.ParseListener<Element> listener) throws TdomXmlException, TdomAttributeException, TdomContentException -
parsePlus
static Element_option[] parsePlus(SAXEventStream in, Extension ext, TypedNode.ParseListener<Element> listener) throws TdomXmlException, TdomAttributeException, TdomContentException -
parseOptional
static Element_option parseOptional(SAXEventStream in, Extension ext, TypedNode.ParseListener<Element> listener) throws TdomXmlException, TdomAttributeException, TdomContentException -
lookahead
-
parse
public static Element_option parse(SAXEventStream in, Extension ext, TypedNode.ParseListener<Element> listener) throws TdomXmlException, TdomAttributeException, TdomContentException -
semiparseStar
static Element_option[] semiparseStar(Iterators.MultipleLookaheadIterator<? extends Element> i) throws TdomContentException - Throws:
TdomContentException
-
semiparsePlus
static Element_option[] semiparsePlus(Iterators.MultipleLookaheadIterator<? extends Element> i) throws TdomContentException - Throws:
TdomContentException
-
semiparseOptional
@Opt static @Opt Element_option semiparseOptional(Iterators.MultipleLookaheadIterator<? extends Element> i) throws TdomContentException - Throws:
TdomContentException
-
lookahead
static boolean lookahead(Iterators.MultipleLookaheadIterator<? extends Element> i, boolean optional) -
semiparse
static Element_option semiparse(Iterators.MultipleLookaheadIterator<? extends Element> i) throws TdomContentException - Throws:
TdomContentException
-
host
Description copied from interface:Visitable
Send the visitor to this instance. -
identify
- Specified by:
identify
in interfaceMatchable<BaseMatcher>
-
initAttrs
- Throws:
TdomAttributeSyntaxException
-
initAttrsSafe
protected void initAttrsSafe() -
checkRequiredAttrs
-
getInterfaceInfo
Give reflexive info object about the generated class.
-