com.sun.msv.reader.xmlschema
Class AttributeWildcardComputer

java.lang.Object
  extended by com.sun.msv.grammar.util.ExpressionWalker
      extended by com.sun.msv.reader.xmlschema.AttributeWildcardComputer
All Implemented Interfaces:
ExpressionVisitorVoid

public class AttributeWildcardComputer
extends ExpressionWalker

Processes the attribtue wildcard according to the spec.

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.

Author:
Kohsuke KAWAGUCHI

Method Summary
static void compute(XMLSchemaReader reader, Expression topLevel)
           
 void onElement(ElementExp exp)
           
 void onRef(ReferenceExp exp)
           
 
Methods inherited from class com.sun.msv.grammar.util.ExpressionWalker
onAnyString, onAttribute, onBinExp, onChoice, onConcur, onData, onEpsilon, onInterleave, onList, onMixed, onNullSet, onOneOrMore, onOther, onSequence, onValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

compute

public static void compute(XMLSchemaReader reader,
                           Expression topLevel)

onElement

public void onElement(ElementExp exp)
Specified by:
onElement in interface ExpressionVisitorVoid
Overrides:
onElement in class ExpressionWalker

onRef

public void onRef(ReferenceExp exp)
Specified by:
onRef in interface ExpressionVisitorVoid
Overrides:
onRef in class ExpressionWalker