Since the definition of the attribute wildcard is very adhoc, it cannot be naturally caputred by our AGM.
Therefore, when we parse a schema, we just parse <anyAttribute> directly. After all components are loaded, arcane computation is done to correctly compute the attribute wildcard.
Attribute wildcard will be ultimately converted into an expression, and that
will be attached to the ComplexTypeExp#attWildcard.
This class also computes the attribute propagation that happens only when a complex type is derived by restriction. Consider the following fragment:
<complexType name="base">
<attribute name="abc" ... />
</complexType>
<complexType name="derived">
<complexContent>
<restriction base="base"/>
</complexContent>
</complexType>
According to the spec, the derived type will have the 'abc' attribute. By "propagation", we mean this behavior.
| Modifier and Type | Field and Description |
|---|---|
| private final XMLSchemaReader | |
| private final Stack | |
| private final Set | visitedExps
Visited ElementExps and ReferenceExps to prevent infinite recursion. |
| private Set | wildcards
Used to collect AttributeWildcards of children. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private AttributeWildcard | calcCompleteWildcard(AttributeWildcard local, Set<AttributeWildcard> s)
Computes the "complete attribute wildcard" |
| private AttributeWildcard | |
| public static void | |
| private void | |
| public void | |
| public void | onRef(ReferenceExp exp)
Overrides com. Implements com. |
| private void |
| reader | back to summary |
|---|---|
| private final XMLSchemaReader reader | |
| unprocessedElementExps | back to summary |
|---|---|
| private final Stack<Expression> unprocessedElementExps | |
| visitedExps | back to summary |
|---|---|
| private final Set<Expression> visitedExps Visited ElementExps and ReferenceExps to prevent infinite recursion. | |
| wildcards | back to summary |
|---|---|
| private Set<AttributeWildcard> wildcards Used to collect AttributeWildcards of children. | |
| AttributeWildcardComputer | back to summary |
|---|---|
| protected AttributeWildcardComputer(XMLSchemaReader _reader) | |
| calcCompleteWildcard | back to summary |
|---|---|
| private AttributeWildcard calcCompleteWildcard(AttributeWildcard local, Set<AttributeWildcard> s) Computes the "complete attribute wildcard" | |
| calcComplexTypeWildcard | back to summary |
|---|---|
| private AttributeWildcard calcComplexTypeWildcard(AttributeWildcard complete, AttributeWildcard base) | |
| compute | back to summary |
|---|---|
| public static void compute(XMLSchemaReader reader, Expression topLevel) | |
| compute | back to summary |
|---|---|
| private void compute(Expression topLevel) | |
| onElement | back to summary |
|---|---|
| public void onElement(ElementExp exp) Overrides com. Implements com. | |
| onRef | back to summary |
|---|---|
| public void onRef(ReferenceExp exp) Overrides com. Implements com. | |
| propagateAttributes | back to summary |
|---|---|
| private void propagateAttributes(final ComplexTypeExp cexp) Computes the propagated attributes. | |