neilg 2003/06/23 10:11:03 Modified: java/src/org/apache/xerces/impl/dv/xs XSSimpleTypeDecl.java Log: add annotation support to simple types Revision Changes Path 1.39 +28 -10 xml-xerces/java/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java Index: XSSimpleTypeDecl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- XSSimpleTypeDecl.java 18 Jun 2003 17:04:59 -0000 1.38 +++ XSSimpleTypeDecl.java 23 Jun 2003 17:11:02 -0000 1.39 @@ -69,7 +69,7 @@ import org.apache.xerces.impl.dv.XSSimpleType; import org.apache.xerces.impl.xpath.regex.RegularExpression; import org.apache.xerces.impl.xs.psvi.StringList; -import org.apache.xerces.impl.xs.psvi.XSAnnotation; +import org.apache.xerces.impl.xs.XSAnnotationImpl; import org.apache.xerces.impl.xs.psvi.XSConstants; import org.apache.xerces.impl.xs.psvi.XSNamespaceItem; import org.apache.xerces.impl.xs.psvi.XSObjectList; @@ -260,6 +260,9 @@ private Object fMinExclusive; private Object fMinInclusive; + // optional annotations + private XSObjectList fAnnotations = null; + private short fPatternType = SPECIAL_PATTERN_NONE; // for fundamental facets @@ -293,14 +296,17 @@ this.fBounded = bounded; this.fFinite = finite; this.fNumeric = numeric; + fAnnotations = null; } //Create a new simple type for restriction. - protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable) { + protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, + XSObjectList annotations) { fBase = base; fTypeName = name; fTargetNamespace = uri; fFinalSet = finalSet; + fAnnotations = annotations; fVariety = fBase.fVariety; fValidationDV = fBase.fValidationDV; @@ -340,11 +346,13 @@ } //Create a new simple type for list. - protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, boolean isImmutable) { + protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, boolean isImmutable, + XSObjectList annotations) { fBase = fAnySimpleType; fTypeName = name; fTargetNamespace = uri; fFinalSet = finalSet; + fAnnotations = annotations; fVariety = VARIETY_LIST; fItemType = (XSSimpleTypeDecl)itemType; @@ -359,11 +367,13 @@ } //Create a new simple type for union. - protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes) { + protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, + XSObjectList annotations) { fBase = fAnySimpleType; fTypeName = name; fTargetNamespace = uri; fFinalSet = finalSet; + fAnnotations = annotations; fVariety = VARIETY_UNION; fMemberTypes = memberTypes; @@ -383,13 +393,15 @@ } //set values for restriction. - protected XSSimpleTypeDecl setRestrictionValues(XSSimpleTypeDecl base, String name, String uri, short finalSet) { + protected XSSimpleTypeDecl setRestrictionValues(XSSimpleTypeDecl base, String name, String uri, short finalSet, + XSObjectList annotations) { //decline to do anything if the object is immutable. if(fIsImmutable) return null; fBase = base; fTypeName = name; fTargetNamespace = uri; fFinalSet = finalSet; + fAnnotations = annotations; fVariety = fBase.fVariety; fValidationDV = fBase.fValidationDV; @@ -429,13 +441,15 @@ } //set values for list. - protected XSSimpleTypeDecl setListValues(String name, String uri, short finalSet, XSSimpleTypeDecl itemType) { + protected XSSimpleTypeDecl setListValues(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, + XSObjectList annotations) { //decline to do anything if the object is immutable. if(fIsImmutable) return null; fBase = fAnySimpleType; fTypeName = name; fTargetNamespace = uri; fFinalSet = finalSet; + fAnnotations = annotations; fVariety = VARIETY_LIST; fItemType = (XSSimpleTypeDecl)itemType; @@ -450,13 +464,15 @@ } //set values for union. - protected XSSimpleTypeDecl setUnionValues(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes) { + protected XSSimpleTypeDecl setUnionValues(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, + XSObjectList annotations) { //decline to do anything if the object is immutable. if(fIsImmutable) return null; fBase = fAnySimpleType; fTypeName = name; fTargetNamespace = uri; fFinalSet = finalSet; + fAnnotations = annotations; fVariety = VARIETY_UNION; fMemberTypes = memberTypes; @@ -1900,9 +1916,9 @@ return new StringListImpl(strs, size); } - public XSAnnotation getAnnotation() { + public XSObjectList getAnnotations() { // REVISIT: SCAPI: to implement - return null; + return fAnnotations; } private void caclFundamentalFacets() { @@ -2276,6 +2292,7 @@ fMinInclusive = null; fPatternType = SPECIAL_PATTERN_NONE; + fAnnotations = null; // REVISIT: reset for fundamental facets } @@ -2293,5 +2310,6 @@ public String toString() { return this.fTargetNamespace+"," +this.fTypeName; } + } // class XSSimpleTypeDecl
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]