@User public abstract static class TypedElement.MixedContent<E extends TypedElement<E,X>,X extends TypedExtension> extends Object implements TypedContent
<!ELEMENT e (#PCDATA) >
" and
"<!ELEMENT e (#PCDATA | x | y | z)* >
".
Element.UnmixedContent
").
TypedChoice
, etc.,
are only needed to realize these "sums of types" in a type-safe way !-)
implements Visitable<..>
" and
"implements Matchable<..>
" are added not here, but in
generated code, since they are specific for the generated base classes.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>
Modifier and Type | Field and Description |
---|---|
static int |
ALT_PCDATA |
protected int |
altIndex |
protected TypedSubstantial<X> |
content |
Modifier | Constructor and Description |
---|---|
protected |
MixedContent(int altIndex,
E element) |
|
MixedContent(String pcdata)
Creates the variant corresponding to the "
#PCDATA " in the content model. |
|
MixedContent(TypedPCData pcdata)
Creates the variant corresponding to the "
#PCDATA " in the content model. |
Modifier and Type | Method and Description |
---|---|
void |
encode(EncodingOutputStream out,
X ext) |
abstract int |
getAltCount()
Returns the number of different variants, NOT including "
#PCDATA "
in the content model. |
int |
getAltIndex() |
TypedSubstantial<X> |
getContent() |
boolean |
isPCData()
Returns whether this is the "
#PCDATA " variant. |
@Opt TypedPCData |
toPCData()
Returns the unwrapped PCDATA content, or null if it is not this variant.
|
public static final int ALT_PCDATA
protected final int altIndex
protected final TypedSubstantial<X extends TypedExtension> content
@User public MixedContent(String pcdata)
#PCDATA
" in the content model.@User public MixedContent(TypedPCData pcdata)
#PCDATA
" in the content model.protected MixedContent(int altIndex, E element)
public TypedSubstantial<X> getContent()
@User public abstract int getAltCount()
#PCDATA
"
in the content model.#PCDATA
".public final int getAltIndex()
@User public final boolean isPCData()
#PCDATA
" variant.#PCDATA
" variant.@User @Opt public final @Opt TypedPCData toPCData()
public final void encode(EncodingOutputStream out, X ext) throws IOException
IOException
see also the complete user documentation .