Return-Path: Delivered-To: apmail-xerces-commits-archive@www.apache.org Received: (qmail 47856 invoked from network); 18 Oct 2010 22:09:52 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Oct 2010 22:09:52 -0000 Received: (qmail 16751 invoked by uid 500); 18 Oct 2010 22:09:52 -0000 Delivered-To: apmail-xerces-commits-archive@xerces.apache.org Received: (qmail 16722 invoked by uid 500); 18 Oct 2010 22:09:52 -0000 Mailing-List: contact commits-help@xerces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@xerces.apache.org Received: (qmail 16715 invoked by uid 99); 18 Oct 2010 22:09:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Oct 2010 22:09:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Oct 2010 22:09:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B42A723888DD; Mon, 18 Oct 2010 22:08:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1024040 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: dom/ impl/dv/ impl/dv/util/ impl/dv/xs/ impl/xs/ xs/ xs/datatypes/ Date: Mon, 18 Oct 2010 22:08:42 -0000 To: commits@xerces.apache.org From: sandygao@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101018220842.B42A723888DD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sandygao Date: Mon Oct 18 22:08:41 2010 New Revision: 1024040 URL: http://svn.apache.org/viewvc?rev=1024040&view=rev Log: For Jira issue https://issues.apache.org/jira/browse/XERCESJ-1469. Update XSModel interfaces to a) expose an interface for values, and b) expose Identity Constraint definitions as top-level components. Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIAttrNSImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/ValidatedInfo.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/util/ByteListImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AttributePSVImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeDecl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSElementDecl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSModelImpl.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/ItemPSVI.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSAttributeDeclaration.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSAttributeUse.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSElementDeclaration.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSFacet.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSModel.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSMultiValueFacet.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSNamespaceItem.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/datatypes/ByteList.java Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIAttrNSImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIAttrNSImpl.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIAttrNSImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIAttrNSImpl.java Mon Oct 18 22:08:41 2010 @@ -22,14 +22,15 @@ import java.io.NotSerializableException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import org.apache.xerces.impl.dv.ValidatedInfo; import org.apache.xerces.impl.xs.util.StringListImpl; import org.apache.xerces.xs.AttributePSVI; import org.apache.xerces.xs.ShortList; import org.apache.xerces.xs.StringList; import org.apache.xerces.xs.XSAttributeDeclaration; -import org.apache.xerces.xs.XSConstants; import org.apache.xerces.xs.XSSimpleTypeDefinition; import org.apache.xerces.xs.XSTypeDefinition; +import org.apache.xerces.xs.XSValue; /** * Attribute namespace implementation; stores PSVI attribute items. @@ -71,20 +72,8 @@ public class PSVIAttrNSImpl extends Attr * value in the original document, this is true; otherwise, it is false */ protected boolean fSpecified = true; - /** schema normalized value property */ - protected String fNormalizedValue = null; - - /** schema actual value */ - protected Object fActualValue = null; - - /** schema actual value type */ - protected short fActualValueType = XSConstants.UNAVAILABLE_DT; - - /** actual value types if the value is a list */ - protected ShortList fItemValueTypes = null; - - /** member type definition against which attribute was validated */ - protected XSSimpleTypeDefinition fMemberType = null; + /** Schema value */ + protected ValidatedInfo fValue = new ValidatedInfo(); /** validation attempted: none, partial, full */ protected short fValidationAttempted = AttributePSVI.VALIDATION_NONE; @@ -123,7 +112,7 @@ public class PSVIAttrNSImpl extends Attr * @return the normalized value of this item after validation */ public String getSchemaNormalizedValue() { - return fNormalizedValue; + return fValue.getNormalizedValue(); } /** @@ -207,7 +196,7 @@ public class PSVIAttrNSImpl extends Attr * @return a simple type declaration */ public XSSimpleTypeDefinition getMemberTypeDefinition() { - return fMemberType; + return fValue.getMemberTypeDefinition(); } /** @@ -232,12 +221,8 @@ public class PSVIAttrNSImpl extends Attr this.fValidationAttempted = attr.getValidationAttempted(); this.fErrorCodes = attr.getErrorCodes(); this.fErrorMessages = attr.getErrorMessages(); - this.fNormalizedValue = attr.getSchemaNormalizedValue(); - this.fActualValue = attr.getActualNormalizedValue(); - this.fActualValueType = attr.getActualNormalizedValueType(); - this.fItemValueTypes = attr.getItemValueTypes(); + this.fValue.copyFrom(attr.getSchemaValue()); this.fTypeDecl = attr.getTypeDefinition(); - this.fMemberType = attr.getMemberTypeDefinition(); this.fSpecified = attr.getIsSchemaSpecified(); } @@ -245,21 +230,28 @@ public class PSVIAttrNSImpl extends Attr * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValue() */ public Object getActualNormalizedValue() { - return this.fActualValue; + return fValue.getActualValue(); } /* (non-Javadoc) * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValueType() */ public short getActualNormalizedValueType() { - return this.fActualValueType; + return fValue.getActualValueType(); } /* (non-Javadoc) * @see org.apache.xerces.xs.ItemPSVI#getItemValueTypes() */ public ShortList getItemValueTypes() { - return this.fItemValueTypes; + return fValue.getListValueTypes(); + } + + /* (non-Javadoc) + * @see org.apache.xerces.xs.ItemPSVI#getSchemaValue() + */ + public XSValue getSchemaValue() { + return fValue; } // REVISIT: Forbid serialization of PSVI DOM until Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java Mon Oct 18 22:08:41 2010 @@ -22,16 +22,18 @@ import java.io.NotSerializableException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import org.apache.xerces.impl.dv.ValidatedInfo; import org.apache.xerces.impl.xs.util.StringListImpl; import org.apache.xerces.xs.ElementPSVI; import org.apache.xerces.xs.ShortList; import org.apache.xerces.xs.StringList; -import org.apache.xerces.xs.XSConstants; +import org.apache.xerces.xs.XSComplexTypeDefinition; import org.apache.xerces.xs.XSElementDeclaration; import org.apache.xerces.xs.XSModel; import org.apache.xerces.xs.XSNotationDeclaration; import org.apache.xerces.xs.XSSimpleTypeDefinition; import org.apache.xerces.xs.XSTypeDefinition; +import org.apache.xerces.xs.XSValue; /** * Element namespace implementation; stores PSVI element items. @@ -78,24 +80,12 @@ public class PSVIElementNSImpl extends E */ protected boolean fSpecified = true; - /** schema normalized value property */ - protected String fNormalizedValue = null; - - /** schema actual value */ - protected Object fActualValue = null; - - /** schema actual value type */ - protected short fActualValueType = XSConstants.UNAVAILABLE_DT; - - /** actual value types if the value is a list */ - protected ShortList fItemValueTypes = null; + /** Schema value */ + protected ValidatedInfo fValue = new ValidatedInfo(); /** http://www.w3.org/TR/xmlschema-1/#e-notation*/ protected XSNotationDeclaration fNotation = null; - /** member type definition against which element was validated */ - protected XSSimpleTypeDefinition fMemberType = null; - /** validation attempted: none, partial, full */ protected short fValidationAttempted = ElementPSVI.VALIDATION_NONE; @@ -136,7 +126,7 @@ public class PSVIElementNSImpl extends E * @return the normalized value of this item after validation */ public String getSchemaNormalizedValue() { - return fNormalizedValue; + return fValue.getNormalizedValue(); } /** @@ -237,7 +227,7 @@ public class PSVIElementNSImpl extends E * @return a simple type declaration */ public XSSimpleTypeDefinition getMemberTypeDefinition() { - return fMemberType; + return fValue.getMemberTypeDefinition(); } /** @@ -275,11 +265,14 @@ public class PSVIElementNSImpl extends E this.fValidationAttempted = elem.getValidationAttempted(); this.fErrorCodes = elem.getErrorCodes(); this.fErrorMessages = elem.getErrorMessages(); - this.fNormalizedValue = elem.getSchemaNormalizedValue(); - this.fActualValue = elem.getActualNormalizedValue(); - this.fActualValueType = elem.getActualNormalizedValueType(); - this.fItemValueTypes = elem.getItemValueTypes(); - this.fMemberType = elem.getMemberTypeDefinition(); + if (fTypeDecl instanceof XSSimpleTypeDefinition || + fTypeDecl instanceof XSComplexTypeDefinition && + ((XSComplexTypeDefinition)fTypeDecl).getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE) { + this.fValue.copyFrom(elem.getSchemaValue()); + } + else { + this.fValue.reset(); + } this.fSpecified = elem.getIsSchemaSpecified(); this.fNil = elem.getNil(); } @@ -288,21 +281,28 @@ public class PSVIElementNSImpl extends E * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValue() */ public Object getActualNormalizedValue() { - return this.fActualValue; + return fValue.getActualValue(); } /* (non-Javadoc) * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValueType() */ public short getActualNormalizedValueType() { - return this.fActualValueType; + return fValue.getActualValueType(); } /* (non-Javadoc) * @see org.apache.xerces.xs.ItemPSVI#getItemValueTypes() */ public ShortList getItemValueTypes() { - return this.fItemValueTypes; + return fValue.getListValueTypes(); + } + + /* (non-Javadoc) + * @see org.apache.xerces.xs.ItemPSVI#getSchemaValue() + */ + public XSValue getSchemaValue() { + return fValue; } // REVISIT: Forbid serialization of PSVI DOM until Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/ValidatedInfo.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/ValidatedInfo.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/ValidatedInfo.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/ValidatedInfo.java Mon Oct 18 22:08:41 2010 @@ -17,8 +17,13 @@ package org.apache.xerces.impl.dv; +import org.apache.xerces.impl.xs.util.ShortListImpl; +import org.apache.xerces.impl.xs.util.XSObjectListImpl; import org.apache.xerces.xs.ShortList; import org.apache.xerces.xs.XSConstants; +import org.apache.xerces.xs.XSObjectList; +import org.apache.xerces.xs.XSSimpleTypeDefinition; +import org.apache.xerces.xs.XSValue; /** * Class to get the information back after content is validated. This info @@ -30,7 +35,7 @@ import org.apache.xerces.xs.XSConstants; * * @version $Id$ */ -public class ValidatedInfo { +public class ValidatedInfo implements XSValue { /** * The normalized value of a string value @@ -52,6 +57,11 @@ public class ValidatedInfo { public short actualValueType; /** + * The declared type of the value. + */ + public XSSimpleType actualType; + + /** * If the type is a union type, then the member type which * actually validated the string value. */ @@ -81,6 +91,7 @@ public class ValidatedInfo { this.normalizedValue = null; this.actualValue = null; this.actualValueType = XSConstants.UNAVAILABLE_DT; + this.actualType = null; this.memberType = null; this.memberTypes = null; this.itemValueTypes = null; @@ -154,4 +165,71 @@ public class ValidatedInfo { /** Other types. */ return valueType; } -} \ No newline at end of file + + // XSValue methods + + public Object getActualValue() { + return actualValue; + } + + public short getActualValueType() { + return actualValueType; + } + + public ShortList getListValueTypes() { + return itemValueTypes == null ? ShortListImpl.EMPTY_LIST : itemValueTypes; + } + + public XSObjectList getMemberTypeDefinitions() { + if (memberTypes == null) { + return XSObjectListImpl.EMPTY_LIST; + } + return new XSObjectListImpl(memberTypes, memberTypes.length); + } + + public String getNormalizedValue() { + return normalizedValue; + } + + public XSSimpleTypeDefinition getTypeDefinition() { + return actualType; + } + + public XSSimpleTypeDefinition getMemberTypeDefinition() { + return memberType; + } + + public void copyFrom(XSValue o) { + if (o == null) { + reset(); + } + else if (o instanceof ValidatedInfo) { + ValidatedInfo other = (ValidatedInfo)o; + normalizedValue = other.normalizedValue; + actualValue = other.actualValue; + actualValueType = other.actualValueType; + actualType = other.actualType; + memberType = other.memberType; + memberTypes = other.memberTypes; + itemValueTypes = other.itemValueTypes; + } + else { + normalizedValue = o.getNormalizedValue(); + actualValue = o.getActualValue(); + actualValueType = o.getActualValueType(); + actualType = (XSSimpleType)o.getTypeDefinition(); + memberType = (XSSimpleType)o.getMemberTypeDefinition(); + XSObjectList members = o.getMemberTypeDefinitions(); + if (members == null || members.getLength() == 0) { + memberTypes = null; + } + else { + memberTypes = new XSSimpleType[members.getLength()]; + for (int i = 0; i < members.getLength(); i++) { + memberTypes[i] = (XSSimpleType)members.get(i); + } + } + itemValueTypes = o.getListValueTypes(); + } + } +} Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/util/ByteListImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/util/ByteListImpl.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/util/ByteListImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/util/ByteListImpl.java Mon Oct 18 22:08:41 2010 @@ -101,5 +101,11 @@ public class ByteListImpl extends Abstra public int size() { return getLength(); } + + public byte[] toByteArray() { + byte[] ret = new byte[data.length]; + System.arraycopy(data, 0, ret, 0, data.length); + return ret; + } } Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java Mon Oct 18 22:08:41 2010 @@ -17,6 +17,7 @@ package org.apache.xerces.impl.dv.xs; +import java.math.BigInteger; import java.util.AbstractList; import java.util.Locale; import java.util.StringTokenizer; @@ -32,6 +33,7 @@ import org.apache.xerces.impl.dv.XSFacet import org.apache.xerces.impl.dv.XSSimpleType; import org.apache.xerces.impl.xpath.regex.RegularExpression; import org.apache.xerces.impl.xs.SchemaSymbols; +import org.apache.xerces.impl.xs.util.ObjectListImpl; import org.apache.xerces.impl.xs.util.ShortListImpl; import org.apache.xerces.impl.xs.util.StringListImpl; import org.apache.xerces.impl.xs.util.XSObjectListImpl; @@ -287,9 +289,8 @@ public class XSSimpleTypeDecl implements private int fMinScale; //for XML Schema 1.1 private Vector fPattern; private Vector fPatternStr; - private Vector fEnumeration; - private short[] fEnumerationType; - private ShortList[] fEnumerationItemType; // used in case fenumerationType value is LIST or LISTOFUNION + private ValidatedInfo[] fEnumeration; + private int fEnumerationSize; private ShortList fEnumerationTypeList; private ObjectList fEnumerationItemTypeList; private StringList fLexicalPattern; @@ -414,8 +415,7 @@ public class XSSimpleTypeDecl implements fPattern = fBase.fPattern; fPatternStr = fBase.fPatternStr; fEnumeration = fBase.fEnumeration; - fEnumerationType = fBase.fEnumerationType; - fEnumerationItemType = fBase.fEnumerationItemType; + fEnumerationSize = fBase.fEnumerationSize; fAssertion = fBase.fAssertion; // added for XML Schema 1.1 fWhiteSpace = fBase.fWhiteSpace; fMaxExclusive = fBase.fMaxExclusive; @@ -542,8 +542,7 @@ public class XSSimpleTypeDecl implements fPattern = fBase.fPattern; fPatternStr = fBase.fPatternStr; fEnumeration = fBase.fEnumeration; - fEnumerationType = fBase.fEnumerationType; - fEnumerationItemType = fBase.fEnumerationItemType; + fEnumerationSize = fBase.fEnumerationSize; fWhiteSpace = fBase.fWhiteSpace; fMaxExclusive = fBase.fMaxExclusive; fMaxInclusive = fBase.fMaxInclusive; @@ -920,22 +919,20 @@ public class XSSimpleTypeDecl implements if ((allowedFacet & FACET_ENUMERATION) == 0) { reportError("cos-applicable-facets", new Object[]{"enumeration", fTypeName}); } else { - fEnumeration = new Vector(); Vector enumVals = facets.enumeration; - fEnumerationType = new short[enumVals.size()]; - fEnumerationItemType = new ShortList[enumVals.size()]; + int size = enumVals.size(); + fEnumeration = new ValidatedInfo[size]; Vector enumNSDecls = facets.enumNSDecls; ValidationContextImpl ctx = new ValidationContextImpl(context); enumerationAnnotations = facets.enumAnnotations; - for (int i = 0; i < enumVals.size(); i++) { + fEnumerationSize = 0; + for (int i = 0; i < size; i++) { if (enumNSDecls != null) ctx.setNSContext((NamespaceContext)enumNSDecls.elementAt(i)); try { - ValidatedInfo info = getActualEnumValue((String)enumVals.elementAt(i), ctx, tempInfo); + ValidatedInfo info = getActualEnumValue((String)enumVals.elementAt(i), ctx, null); // check 4.3.5.c0 must: enumeration values from the value space of base - fEnumeration.addElement(info.actualValue); - fEnumerationType[i] = info.actualValueType; - fEnumerationItemType[i] = info.itemValueTypes; + fEnumeration[fEnumerationSize++] = info; } catch (InvalidDatatypeValueException ide) { reportError("enumeration-valid-restriction", new Object[]{enumVals.elementAt(i), this.getBaseType().getName()}); } @@ -1645,6 +1642,7 @@ public class XSSimpleTypeDecl implements if ((fFacetsDefined & FACET_ENUMERATION) == 0 && (fBase.fFacetsDefined & FACET_ENUMERATION) != 0) { fFacetsDefined |= FACET_ENUMERATION; fEnumeration = fBase.fEnumeration; + fEnumerationSize = fBase.fEnumerationSize; enumerationAnnotations = fBase.enumerationAnnotations; } // inherit maxExclusive @@ -1864,16 +1862,16 @@ public class XSSimpleTypeDecl implements //enumeration if ( ((fFacetsDefined & FACET_ENUMERATION) != 0 ) ) { boolean present = false; - final int enumSize = fEnumeration.size(); + final int enumSize = fEnumerationSize; final short primitiveType1 = convertToPrimitiveKind(type); for (int i = 0; i < enumSize; i++) { - final short primitiveType2 = convertToPrimitiveKind(fEnumerationType[i]); + final short primitiveType2 = convertToPrimitiveKind(fEnumeration[i].actualValueType); if ((primitiveType1 == primitiveType2 || primitiveType1 == XSConstants.ANYSIMPLETYPE_DT && primitiveType2 == XSConstants.STRING_DT || primitiveType1 == XSConstants.STRING_DT && primitiveType2 == XSConstants.ANYSIMPLETYPE_DT) - && fEnumeration.elementAt(i).equals(ob)) { + && fEnumeration[i].actualValue.equals(ob)) { if (primitiveType1 == XSConstants.LIST_DT || primitiveType1 == XSConstants.LISTOFUNION_DT) { - ShortList enumItemType = fEnumerationItemType[i]; + ShortList enumItemType = fEnumeration[i].itemValueTypes; final int typeList1Length = itemType != null ? itemType.getLength() : 0; final int typeList2Length = enumItemType != null ? enumItemType.getLength() : 0; if (typeList1Length == typeList2Length) { @@ -1902,8 +1900,10 @@ public class XSSimpleTypeDecl implements } } if(!present){ + StringBuffer sb = new StringBuffer(); + appendEnumString(sb); throw new InvalidDatatypeValueException("cvc-enumeration-valid", - new Object [] {content, fEnumeration.toString()}); + new Object [] {content, sb.toString()}); } } @@ -2044,6 +2044,8 @@ public class XSSimpleTypeDecl implements ValidatedInfo validatedInfo, boolean needNormalize) throws InvalidDatatypeValueException{ + validatedInfo.actualType = this; + String nvalue; if (needNormalize) { nvalue = normalize(content, fWhiteSpace); @@ -2152,6 +2154,8 @@ public class XSSimpleTypeDecl implements validatedInfo.memberType = fMemberTypes[i]; } + // Set this again because it was changed to the member type + validatedInfo.actualType = this; return aValue; } catch(InvalidDatatypeValueException invalidValue) { } @@ -2169,14 +2173,8 @@ public class XSSimpleTypeDecl implements } typesBuffer.append(decl.fTypeName); if(decl.fEnumeration != null) { - Vector v = decl.fEnumeration; - typesBuffer.append(" : ["); - for(int j = 0;j < v.size(); j++) { - if(j != 0) - typesBuffer.append(','); - typesBuffer.append(v.elementAt(j)); - } - typesBuffer.append(']'); + typesBuffer.append(" : "); + decl.appendEnumString(typesBuffer); } } throw new InvalidDatatypeValueException("cvc-datatype-valid.1.2.3", @@ -2478,10 +2476,10 @@ public class XSSimpleTypeDecl implements if (fLexicalEnumeration == null){ if (fEnumeration == null) return StringListImpl.EMPTY_LIST; - int size = fEnumeration.size(); + int size = fEnumerationSize; String[] strs = new String[size]; for (int i = 0; i < size; i++) - strs[i] = fEnumeration.elementAt(i).toString(); + strs[i] = fEnumeration[i].normalizedValue; fLexicalEnumeration = new StringListImpl(strs, size); } return fLexicalEnumeration; @@ -2495,16 +2493,24 @@ public class XSSimpleTypeDecl implements if (fActualEnumeration == null) { fActualEnumeration = new AbstractObjectList() { public int getLength() { - return (fEnumeration != null) ? fEnumeration.size() : 0; + return (fEnumeration != null) ? fEnumerationSize : 0; } public boolean contains(Object item) { - return (fEnumeration != null && fEnumeration.contains(item)); + if (fEnumeration == null) { + return false; + } + for (int i = 0; i < fEnumerationSize; i++) { + if (fEnumeration[i].getActualValue().equals(item)) { + return true; + } + } + return false; } public Object item(int index) { if (index < 0 || index >= getLength()) { return null; } - return fEnumeration.elementAt(index); + return fEnumeration[index].getActualValue(); } }; } @@ -2517,17 +2523,18 @@ public class XSSimpleTypeDecl implements */ public ObjectList getEnumerationItemTypeList() { if (fEnumerationItemTypeList == null) { - if(fEnumerationItemType == null) + if (fEnumeration == null) { return null; + } fEnumerationItemTypeList = new AbstractObjectList() { public int getLength() { - return (fEnumerationItemType != null) ? fEnumerationItemType.length : 0; + return (fEnumeration != null) ? fEnumerationSize : 0; } public boolean contains(Object item) { - if(fEnumerationItemType == null || !(item instanceof ShortList)) + if (fEnumeration == null || !(item instanceof ShortList)) return false; - for(int i = 0;i < fEnumerationItemType.length; i++) - if(fEnumerationItemType[i] == item) + for (int i = 0;i < fEnumerationSize; i++) + if (fEnumeration[i].itemValueTypes == item) return true; return false; } @@ -2535,7 +2542,7 @@ public class XSSimpleTypeDecl implements if (index < 0 || index >= getLength()) { return null; } - return fEnumerationItemType[index]; + return fEnumeration[index].itemValueTypes; } }; } @@ -2544,10 +2551,14 @@ public class XSSimpleTypeDecl implements public ShortList getEnumerationTypeList() { if (fEnumerationTypeList == null) { - if (fEnumerationType == null) { + if (fEnumeration == null) { return ShortListImpl.EMPTY_LIST; } - fEnumerationTypeList = new ShortListImpl (fEnumerationType, fEnumerationType.length); + short[] list = new short[fEnumerationSize]; + for (int i = 0; i < fEnumerationSize; i++) { + list[i] = fEnumeration[i].actualValueType; + } + fEnumerationTypeList = new ShortListImpl(list, fEnumerationSize); } return fEnumerationTypeList; } @@ -3245,10 +3256,11 @@ public class XSSimpleTypeDecl implements fPattern = null; fPatternStr = null; fEnumeration = null; - fEnumerationType = null; - fEnumerationItemType = null; fLexicalPattern = null; fLexicalEnumeration = null; + fActualEnumeration = null; + fEnumerationTypeList = null; + fEnumerationItemTypeList = null; fMaxInclusive = null; fMaxExclusive = null; fMinExclusive = null; @@ -3328,6 +3340,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl( FACET_WHITESPACE, WS_FACET_STRING[fWhiteSpace], + 0, + null, (fFixedFacet & FACET_WHITESPACE) != 0, whiteSpaceAnnotation); count++; @@ -3337,6 +3351,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl( FACET_LENGTH, Integer.toString(fLength), + fLength, + null, (fFixedFacet & FACET_LENGTH) != 0, lengthAnnotation); count++; @@ -3346,6 +3362,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl( FACET_MINLENGTH, Integer.toString(fMinLength), + fMinLength, + null, (fFixedFacet & FACET_MINLENGTH) != 0, minLengthAnnotation); count++; @@ -3355,6 +3373,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl( FACET_MAXLENGTH, Integer.toString(fMaxLength), + fMaxLength, + null, (fFixedFacet & FACET_MAXLENGTH) != 0, maxLengthAnnotation); count++; @@ -3364,6 +3384,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl( FACET_TOTALDIGITS, Integer.toString(fTotalDigits), + fTotalDigits, + null, (fFixedFacet & FACET_TOTALDIGITS) != 0, totalDigitsAnnotation); count++; @@ -3373,6 +3395,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl( FACET_FRACTIONDIGITS, "0", + 0, + null, true, fractionDigitsAnnotation); count++; @@ -3382,6 +3406,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl( FACET_FRACTIONDIGITS, Integer.toString(fFractionDigits), + fFractionDigits, + null, (fFixedFacet & FACET_FRACTIONDIGITS) != 0, fractionDigitsAnnotation); count++; @@ -3391,6 +3417,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl( FACET_MAXINCLUSIVE, fMaxInclusive.toString(), + 0, + fMaxInclusive, (fFixedFacet & FACET_MAXINCLUSIVE) != 0, maxInclusiveAnnotation); count++; @@ -3400,6 +3428,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl( FACET_MAXEXCLUSIVE, fMaxExclusive.toString(), + 0, + fMaxExclusive, (fFixedFacet & FACET_MAXEXCLUSIVE) != 0, maxExclusiveAnnotation); count++; @@ -3409,6 +3439,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl( FACET_MINEXCLUSIVE, fMinExclusive.toString(), + 0, + fMinExclusive, (fFixedFacet & FACET_MINEXCLUSIVE) != 0, minExclusiveAnnotation); count++; @@ -3418,6 +3450,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl( FACET_MININCLUSIVE, fMinInclusive.toString(), + 0, + fMinInclusive, (fFixedFacet & FACET_MININCLUSIVE) != 0, minInclusiveAnnotation); count++; @@ -3427,6 +3461,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl ( FACET_EXPLICITTIMEZONE, ET_FACET_STRING[fExplicitTimezone], + 0, + null, (fFixedFacet & FACET_EXPLICITTIMEZONE) != 0, explicitTimezoneAnnotation); count++; @@ -3436,6 +3472,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl ( FACET_MAXSCALE, Integer.toString(fMaxScale), + fMaxScale, + null, (fFixedFacet & FACET_MAXSCALE) != 0, maxScaleAnnotation); count++; @@ -3445,6 +3483,8 @@ public class XSSimpleTypeDecl implements new XSFacetImpl ( FACET_MINSCALE, Integer.toString(fMinScale), + fMinScale, + null, (fFixedFacet & FACET_MINSCALE) != 0, minScaleAnnotation); count++; @@ -3454,6 +3494,28 @@ public class XSSimpleTypeDecl implements return (fFacets != null) ? fFacets : XSObjectListImpl.EMPTY_LIST; } + public XSObject getFacet(int facetType) { + if (facetType == FACET_ENUMERATION || facetType == FACET_PATTERN) { + XSObjectList list = getMultiValueFacets(); + for (int i = 0; i < list.getLength(); i++) { + XSMultiValueFacet f = (XSMultiValueFacet)list.item(i); + if (f.getFacetKind() == facetType) { + return f; + } + } + } + else { + XSObjectList list = getFacets(); + for (int i = 0; i < list.getLength(); i++) { + XSFacet f = (XSFacet)list.item(i); + if (f.getFacetKind() == facetType) { + return f; + } + } + } + return null; + } + /** * A list of enumeration and pattern constraining facets if it exists, * otherwise an empty XSObjectList. @@ -3475,6 +3537,7 @@ public class XSSimpleTypeDecl implements new XSMVFacetImpl( FACET_PATTERN, this.getLexicalPattern(), + null, patternAnnotations); count++; } @@ -3483,6 +3546,7 @@ public class XSSimpleTypeDecl implements new XSMVFacetImpl( FACET_ENUMERATION, this.getLexicalEnumeration(), + new ObjectListImpl(fEnumeration, fEnumerationSize), enumerationAnnotations); count++; } @@ -3518,13 +3582,17 @@ public class XSSimpleTypeDecl implements private static final class XSFacetImpl implements XSFacet { final short kind; - final String value; + final String svalue; + final int ivalue; + Object avalue; final boolean fixed; final XSObjectList annotations; - public XSFacetImpl(short kind, String value, boolean fixed, XSAnnotation annotation) { + public XSFacetImpl(short kind, String svalue, int ivalue, Object avalue, boolean fixed, XSAnnotation annotation) { this.kind = kind; - this.value = value; + this.svalue = svalue; + this.ivalue = ivalue; + this.avalue = avalue; this.fixed = fixed; if (annotation != null) { @@ -3571,9 +3639,26 @@ public class XSSimpleTypeDecl implements * @see org.apache.xerces.xs.XSFacet#getLexicalFacetValue() */ public String getLexicalFacetValue() { - return value; + return svalue; } + public Object getActualFacetValue() { + if (avalue == null) { + if (kind == FACET_WHITESPACE || kind == FACET_EXPLICITTIMEZONE) { + avalue = svalue; + } + else { + // Must a facet with an integer value. Use BigInteger. + avalue = BigInteger.valueOf(ivalue); + } + } + return avalue; + } + + public int getIntFacetValue() { + return ivalue; + } + /* (non-Javadoc) * @see org.apache.xerces.xs.XSFacet#isFixed() */ @@ -3615,12 +3700,14 @@ public class XSSimpleTypeDecl implements private static final class XSMVFacetImpl implements XSMultiValueFacet { final short kind; final XSObjectList annotations; - final StringList values; + final StringList svalues; + final ObjectList avalues; final Vector asserts; - public XSMVFacetImpl(short kind, StringList values, XSObjectList annotations) { + public XSMVFacetImpl(short kind, StringList svalues, ObjectList avalues, XSObjectList annotations) { this.kind = kind; - this.values = values; + this.svalues = svalues; + this.avalues = avalues; this.annotations = (annotations != null) ? annotations : XSObjectListImpl.EMPTY_LIST; this.asserts = null; } @@ -3630,7 +3717,8 @@ public class XSSimpleTypeDecl implements public XSMVFacetImpl(short kind, Vector asserts) { this.kind = kind; this.asserts = asserts; - this.values = null; + this.svalues = null; + this.avalues = null; this.annotations = null; } @@ -3652,9 +3740,13 @@ public class XSSimpleTypeDecl implements * @see org.apache.xerces.xs.XSMultiValueFacet#getLexicalFacetValues() */ public StringList getLexicalFacetValues() { - return values; + return svalues; } + public ObjectList getEnumerationValues() { + return avalues; + } + /* (non-Javadoc) * @see org.apache.xerces.xs.XSObject#getName() */ @@ -3726,5 +3818,15 @@ public class XSSimpleTypeDecl implements return valueType; } + private void appendEnumString(StringBuffer sb) { + sb.append('['); + for (int i = 0; i < fEnumerationSize; i++) { + if (i != 0) { + sb.append(", "); + } + sb.append(fEnumeration[i].actualValue); + } + sb.append(']'); + } } // class XSSimpleTypeDecl Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java Mon Oct 18 22:08:41 2010 @@ -74,6 +74,10 @@ public class XSSimpleTypeDelegate return type.getFacets(); } + public XSObject getFacet(int facetType) { + return type.getFacet(facetType); + } + public boolean getFinite() { return type.getFinite(); } Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AttributePSVImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AttributePSVImpl.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AttributePSVImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/AttributePSVImpl.java Mon Oct 18 22:08:41 2010 @@ -17,14 +17,15 @@ package org.apache.xerces.impl.xs; +import org.apache.xerces.impl.dv.ValidatedInfo; import org.apache.xerces.impl.xs.util.StringListImpl; import org.apache.xerces.xs.AttributePSVI; import org.apache.xerces.xs.ShortList; import org.apache.xerces.xs.StringList; import org.apache.xerces.xs.XSAttributeDeclaration; -import org.apache.xerces.xs.XSConstants; import org.apache.xerces.xs.XSSimpleTypeDefinition; import org.apache.xerces.xs.XSTypeDefinition; +import org.apache.xerces.xs.XSValue; /** * Attribute PSV infoset augmentations implementation. @@ -47,20 +48,8 @@ public class AttributePSVImpl implements * value in the original document, this is false; otherwise, it is true */ protected boolean fSpecified = false; - /** schema normalized value property */ - protected String fNormalizedValue = null; - - /** schema actual value */ - protected Object fActualValue = null; - - /** schema actual value type */ - protected short fActualValueType = XSConstants.UNAVAILABLE_DT; - - /** actual value types if the value is a list */ - protected ShortList fItemValueTypes = null; - - /** member type definition against which attribute was validated */ - protected XSSimpleTypeDefinition fMemberType = null; + /** Schema value */ + protected ValidatedInfo fValue = new ValidatedInfo(); /** validation attempted: none, partial, full */ protected short fValidationAttempted = AttributePSVI.VALIDATION_NONE; @@ -96,7 +85,7 @@ public class AttributePSVImpl implements * @return the normalized value of this item after validation */ public String getSchemaNormalizedValue() { - return fNormalizedValue; + return fValue.getNormalizedValue(); } /** @@ -180,7 +169,7 @@ public class AttributePSVImpl implements * @return a simple type declaration */ public XSSimpleTypeDefinition getMemberTypeDefinition() { - return fMemberType; + return fValue.getMemberTypeDefinition(); } /** @@ -197,35 +186,38 @@ public class AttributePSVImpl implements * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValue() */ public Object getActualNormalizedValue() { - return this.fActualValue; + return fValue.getActualValue(); } /* (non-Javadoc) * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValueType() */ public short getActualNormalizedValueType() { - return this.fActualValueType; + return fValue.getActualValueType(); } /* (non-Javadoc) * @see org.apache.xerces.xs.ItemPSVI#getItemValueTypes() */ public ShortList getItemValueTypes() { - return this.fItemValueTypes; + return fValue.getListValueTypes(); } + /* (non-Javadoc) + * @see org.apache.xerces.xs.ItemPSVI#getSchemaValue() + */ + public XSValue getSchemaValue() { + return fValue; + } + /** * Reset() */ public void reset() { - fNormalizedValue = null; - fActualValue = null; - fActualValueType = XSConstants.UNAVAILABLE_DT; - fItemValueTypes = null; + fValue.reset(); fDeclaration = null; fTypeDecl = null; fSpecified = false; - fMemberType = null; fValidationAttempted = AttributePSVI.VALIDATION_NONE; fValidity = AttributePSVI.VALIDITY_NOTKNOWN; fErrors = null; Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java Mon Oct 18 22:08:41 2010 @@ -17,17 +17,17 @@ package org.apache.xerces.impl.xs; -import org.apache.xerces.impl.xs.util.ShortListImpl; +import org.apache.xerces.impl.dv.ValidatedInfo; import org.apache.xerces.impl.xs.util.StringListImpl; import org.apache.xerces.xs.ElementPSVI; import org.apache.xerces.xs.ShortList; import org.apache.xerces.xs.StringList; -import org.apache.xerces.xs.XSConstants; import org.apache.xerces.xs.XSElementDeclaration; import org.apache.xerces.xs.XSModel; import org.apache.xerces.xs.XSNotationDeclaration; import org.apache.xerces.xs.XSSimpleTypeDefinition; import org.apache.xerces.xs.XSTypeDefinition; +import org.apache.xerces.xs.XSValue; /** * Element PSV infoset augmentations implementation. @@ -60,24 +60,12 @@ public class ElementPSVImpl implements E */ protected boolean fSpecified = false; - /** schema normalized value property */ - protected String fNormalizedValue = null; - - /** schema actual value */ - protected Object fActualValue = null; - - /** schema actual value type */ - protected short fActualValueType = XSConstants.UNAVAILABLE_DT; - - /** actual value types if the value is a list */ - protected ShortList fItemValueTypes = null; + /** Schema value */ + protected ValidatedInfo fValue = new ValidatedInfo(); /** http://www.w3.org/TR/xmlschema-1/#e-notation*/ protected XSNotationDeclaration fNotation = null; - /** member type definition against which element was validated */ - protected XSSimpleTypeDefinition fMemberType = null; - /** validation attempted: none, partial, full */ protected short fValidationAttempted = ElementPSVI.VALIDATION_NONE; @@ -118,7 +106,7 @@ public class ElementPSVImpl implements E * @return the normalized value of this item after validation */ public String getSchemaNormalizedValue() { - return fNormalizedValue; + return fValue.getNormalizedValue(); } /** @@ -219,7 +207,7 @@ public class ElementPSVImpl implements E * @return a simple type declaration */ public XSSimpleTypeDefinition getMemberTypeDefinition() { - return fMemberType; + return fValue.getMemberTypeDefinition(); } /** @@ -249,23 +237,30 @@ public class ElementPSVImpl implements E * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValue() */ public Object getActualNormalizedValue() { - return this.fActualValue; + return fValue.getActualValue(); } /* (non-Javadoc) * @see org.apache.xerces.xs.ItemPSVI#getActualNormalizedValueType() */ public short getActualNormalizedValueType() { - return this.fActualValueType; + return fValue.getActualValueType(); } /* (non-Javadoc) * @see org.apache.xerces.xs.ItemPSVI#getItemValueTypes() */ public ShortList getItemValueTypes() { - return this.fItemValueTypes != null ? this.fItemValueTypes : ShortListImpl.EMPTY_LIST; + return fValue.getListValueTypes(); } + /* (non-Javadoc) + * @see org.apache.xerces.xs.ItemPSVI#getSchemaValue() + */ + public XSValue getSchemaValue() { + return fValue; + } + /** * Reset() should be called in validator startElement(..) method. */ @@ -275,15 +270,11 @@ public class ElementPSVImpl implements E fNil = false; fSpecified = false; fNotation = null; - fMemberType = null; fValidationAttempted = ElementPSVI.VALIDATION_NONE; fValidity = ElementPSVI.VALIDITY_NOTKNOWN; fErrors = null; fValidationContext = null; - fNormalizedValue = null; - fActualValue = null; - fActualValueType = XSConstants.UNAVAILABLE_DT; - fItemValueTypes = null; + fValue.reset(); } public void copySchemaInformationTo(ElementPSVImpl target) { Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/SchemaGrammar.java Mon Oct 18 22:08:41 2010 @@ -47,6 +47,7 @@ import org.apache.xerces.xs.XSAttributeD import org.apache.xerces.xs.XSAttributeGroupDefinition; import org.apache.xerces.xs.XSConstants; import org.apache.xerces.xs.XSElementDeclaration; +import org.apache.xerces.xs.XSIDCDefinition; import org.apache.xerces.xs.XSModel; import org.apache.xerces.xs.XSModelGroupDefinition; import org.apache.xerces.xs.XSNamedMap; @@ -1421,7 +1422,7 @@ public class SchemaGrammar implements XS false, // model group false, // particle false, // wildcard - false, // idc + true, // idc true, // notation false, // annotation false, // facet @@ -1558,6 +1559,9 @@ public class SchemaGrammar implements XS case XSConstants.NOTATION_DECLARATION: table = fGlobalNotationDecls; break; + case XSConstants.IDENTITY_CONSTRAINT: + table = this.fGlobalIDConstraintDecls; + break; } // for complex/simple types, create a special implementation, @@ -1607,6 +1611,9 @@ public class SchemaGrammar implements XS case XSConstants.NOTATION_DECLARATION: table = fGlobalNotationDeclsExt; break; + case XSConstants.IDENTITY_CONSTRAINT: + table = this.fGlobalIDConstraintDeclsExt; + break; } Object[] entries = table.getEntries(); @@ -1684,6 +1691,10 @@ public class SchemaGrammar implements XS return getGlobalNotationDecl(name); } + public XSIDCDefinition getIDCDefinition(String name) { + return getIDConstraintDecl(name); + } + /** * [document location] Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java Mon Oct 18 22:08:41 2010 @@ -2673,11 +2673,7 @@ public class XMLSchemaValidator if (fDefaultValue != null) fCurrentPSVI.fSpecified = true; - fCurrentPSVI.fMemberType = fValidatedInfo.memberType; - fCurrentPSVI.fNormalizedValue = fValidatedInfo.normalizedValue; - fCurrentPSVI.fActualValue = fValidatedInfo.actualValue; - fCurrentPSVI.fActualValueType = fValidatedInfo.actualValueType; - fCurrentPSVI.fItemValueTypes = fValidatedInfo.itemValueTypes; + fCurrentPSVI.fValue.copyFrom(fValidatedInfo); if (fStrictAssess) { // get all errors for the current element, its attribute, @@ -3313,7 +3309,7 @@ public class XMLSchemaValidator } } if (fIdConstraint) { - attrPSVI.fActualValue = actualValue; + attrPSVI.fValue.copyFrom(fValidatedInfo); } if (fAugPSVI) { @@ -3322,18 +3318,11 @@ public class XMLSchemaValidator // PSVI: attribute type attrPSVI.fTypeDecl = attDV; - // PSVI: attribute memberType - attrPSVI.fMemberType = fValidatedInfo.memberType; // PSVI: attribute normalized value // NOTE: we always store the normalized value, even if it's invlid, // because it might still be useful to the user. But when the it's // not valid, the normalized value is not trustable. - attrPSVI.fNormalizedValue = fValidatedInfo.normalizedValue; - attrPSVI.fActualValue = fValidatedInfo.actualValue; - attrPSVI.fActualValueType = fValidatedInfo.actualValueType; - attrPSVI.fItemValueTypes = fValidatedInfo.itemValueTypes; - - + attrPSVI.fValue.copyFrom(fValidatedInfo); // PSVI: validation attempted: attrPSVI.fValidationAttempted = AttributePSVI.VALIDATION_FULL; @@ -3443,11 +3432,7 @@ public class XMLSchemaValidator attrPSVI.fDeclaration = currDecl; attrPSVI.fTypeDecl = currDecl.fType; - attrPSVI.fMemberType = defaultValue.memberType; - attrPSVI.fNormalizedValue = normalized; - attrPSVI.fActualValue = defaultValue.actualValue; - attrPSVI.fActualValueType = defaultValue.actualValueType; - attrPSVI.fItemValueTypes = defaultValue.itemValueTypes; + attrPSVI.fValue.copyFrom(defaultValue); attrPSVI.fValidationContext = fValidationRoot; attrPSVI.fValidity = AttributePSVI.VALIDITY_VALID; attrPSVI.fValidationAttempted = AttributePSVI.VALIDATION_FULL; Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeDecl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeDecl.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeDecl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeDecl.java Mon Oct 18 22:08:41 2010 @@ -30,6 +30,7 @@ import org.apache.xerces.xs.XSNamespaceI import org.apache.xerces.xs.XSObject; import org.apache.xerces.xs.XSObjectList; import org.apache.xerces.xs.XSSimpleTypeDefinition; +import org.apache.xerces.xs.XSValue; /** * The XML representation for an attribute declaration @@ -224,6 +225,10 @@ public class XSAttributeDecl implements fDefault.itemValueTypes; } + public XSValue getValueConstraintValue() { + return fDefault; + } + public boolean getInheritable() { return fInheritable; } Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSAttributeUseImpl.java Mon Oct 18 22:08:41 2010 @@ -25,6 +25,7 @@ import org.apache.xerces.xs.XSAttributeU import org.apache.xerces.xs.XSConstants; import org.apache.xerces.xs.XSNamespaceItem; import org.apache.xerces.xs.XSObjectList; +import org.apache.xerces.xs.XSValue; /** * The XML representation for an attribute use @@ -143,6 +144,10 @@ public class XSAttributeUseImpl implemen fDefault.itemValueTypes; } + public XSValue getValueConstraintValue() { + return fDefault; + } + /** * Optional. Annotations. */ Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSElementDecl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSElementDecl.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSElementDecl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSElementDecl.java Mon Oct 18 22:08:41 2010 @@ -33,6 +33,7 @@ import org.apache.xerces.xs.XSNamespaceI import org.apache.xerces.xs.XSObject; import org.apache.xerces.xs.XSObjectList; import org.apache.xerces.xs.XSTypeDefinition; +import org.apache.xerces.xs.XSValue; /** * The XML representation for an element declaration @@ -466,4 +467,8 @@ public class XSElementDecl implements XS fDefault.itemValueTypes; } + public XSValue getValueConstraintValue() { + return fDefault; + } + } // class XSElementDecl Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSModelImpl.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSModelImpl.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSModelImpl.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSModelImpl.java Mon Oct 18 22:08:41 2010 @@ -36,6 +36,7 @@ import org.apache.xerces.xs.XSAttributeD import org.apache.xerces.xs.XSAttributeGroupDefinition; import org.apache.xerces.xs.XSConstants; import org.apache.xerces.xs.XSElementDeclaration; +import org.apache.xerces.xs.XSIDCDefinition; import org.apache.xerces.xs.XSModel; import org.apache.xerces.xs.XSModelGroupDefinition; import org.apache.xerces.xs.XSNamedMap; @@ -70,7 +71,7 @@ public final class XSModelImpl extends A false, // model group false, // particle false, // wildcard - false, // idc + true, // idc true, // notation false, // annotation false, // facet @@ -324,6 +325,9 @@ public final class XSModelImpl extends A case XSConstants.NOTATION_DECLARATION: tables[i] = fGrammarList[i].fGlobalNotationDecls; break; + case XSConstants.IDENTITY_CONSTRAINT: + tables[i] = fGrammarList[i].fGlobalIDConstraintDecls; + break; } } // for complex/simple types, create a special implementation, @@ -403,6 +407,9 @@ public final class XSModelImpl extends A case XSConstants.NOTATION_DECLARATION: table = fGrammarList[i].fGlobalNotationDecls; break; + case XSConstants.IDENTITY_CONSTRAINT: + table = fGrammarList[i].fGlobalIDConstraintDecls; + break; } // for complex/simple types, create a special implementation, @@ -593,6 +600,40 @@ public final class XSModelImpl extends A return sg.getGlobalGroupDecl(name, loc); } + /** + * Convenience method. Returns a top-level model group definition. + * + * @param name The name of the definition. + * @param namespace The namespace of the definition, otherwise null. + * @return A top-level model group definition definition or null if such + * definition does not exist. + */ + public XSIDCDefinition getIDCDefinition(String name, String namespace) { + SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace)); + if (sg == null) { + return null; + } + return (XSIDCDefinition)sg.fGlobalIDConstraintDecls.get(name); + } + + /** + * Convenience method. Returns a top-level model group definition. + * + * @param name The name of the definition. + * @param namespace The namespace of the definition, otherwise null. + * @param loc The schema location where the component was defined + * @return A top-level model group definition definition or null if such + * definition does not exist. + */ + public XSIDCDefinition getIDCDefinition(String name, String namespace, + String loc) { + SchemaGrammar sg = (SchemaGrammar)fGrammarMap.get(null2EmptyString(namespace)); + if (sg == null) { + return null; + } + return sg.getIDConstraintDecl(name, loc); + } + /** * @see org.apache.xerces.xs.XSModel#getNotationDeclaration(String, String) Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/ItemPSVI.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/ItemPSVI.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/ItemPSVI.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/ItemPSVI.java Mon Oct 18 22:08:41 2010 @@ -96,15 +96,16 @@ public interface ItemPSVI { /** * [schema normalized value]: the normalized value of this * item after validation. + * + * @deprecated Use getSchemaValue().getNormalizedValue() instead */ public String getSchemaNormalizedValue(); /** * [schema normalized value]: Binding specific actual value * or null if the value is in error. - * @exception XSException - * NOT_SUPPORTED_ERR: Raised if the implementation does not support this - * method. + * + * @deprecated Use getSchemaValue().getActualValue() instead */ public Object getActualNormalizedValue() throws XSException; @@ -118,11 +119,9 @@ public interface ItemPSVI { * method returns LISTOFUNION_DT. To query the actual value * of the list or list of union type definitions use * itemValueTypes. If the actualNormalizedValue - * is null, this method returns UNAVAILABLE_DT - * . - * @exception XSException - * NOT_SUPPORTED_ERR: Raised if the implementation does not support this - * method. + * is null, this method returns UNAVAILABLE_DT. + * + * @deprecated Use getSchemaValue().getActualValueType() instead */ public short getActualNormalizedValueType() throws XSException; @@ -154,14 +153,21 @@ public interface ItemPSVI { * actualNormalizedValueType is LISTOFUNION_DT * , and the itemValueTypes is an array of size 3 with the * following values: INTEGER_DT, INTEGER_DT, STRING_DT. - * @exception XSException - * NOT_SUPPORTED_ERR: Raised if the implementation does not support this - * method. + * + * @deprecated Use getSchemaValue().getListValueTypes() instead */ public ShortList getItemValueTypes() throws XSException; /** + * If this item has a simple type definition or a complex type with simple + * content, then return the value with respect to the simple type. If + * this item doesn't have a simple-typed value, the behavior of this method + * is not specified. + */ + public XSValue getSchemaValue(); + + /** * [type definition]: an item isomorphic to the type * definition used to validate the schema item. */ Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSAttributeDeclaration.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSAttributeDeclaration.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSAttributeDeclaration.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSAttributeDeclaration.java Mon Oct 18 22:08:41 2010 @@ -59,6 +59,8 @@ public interface XSAttributeDeclaration /** * Value constraint: The constraint value with respect to the [type * definition], otherwise null. + * + * @deprecated Use getValueConstraintValue().getNormalizedValue() instead */ public String getConstraintValue(); @@ -69,6 +71,8 @@ public interface XSAttributeDeclaration * @exception XSException * NOT_SUPPORTED_ERR: Raised if the implementation does not support this * method. + * + * @deprecated Use getValueConstraintValue().getActualValue() instead */ public Object getActualVC() throws XSException; @@ -85,6 +89,8 @@ public interface XSAttributeDeclaration * @exception XSException * NOT_SUPPORTED_ERR: Raised if the implementation does not support this * method. + * + * @deprecated Use getValueConstraintValue().getActualValueType() instead */ public short getActualVCType() throws XSException; @@ -100,10 +106,17 @@ public interface XSAttributeDeclaration * @exception XSException * NOT_SUPPORTED_ERR: Raised if the implementation does not support this * method. + * + * @deprecated Use getValueConstraintValue().getListValueTypes() instead */ public ShortList getItemValueTypes() throws XSException; /** + * The actual value of the default or fixed value constraint. + */ + public XSValue getValueConstraintValue(); + + /** * An annotation if it exists, otherwise null. * If not null then the first [annotation] from the sequence of annotations. */ Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSAttributeUse.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSAttributeUse.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSAttributeUse.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSAttributeUse.java Mon Oct 18 22:08:41 2010 @@ -35,12 +35,14 @@ public interface XSAttributeUse extends public XSAttributeDeclaration getAttrDeclaration(); /** - * Value Constraint: one of default, fixed. + * Value Constraint: one of default, fixed, or none. */ public short getConstraintType(); /** * Value Constraint: The constraint value, otherwise null. + * + * @deprecated Use getValueConstraintValue().getNormalizedValue() instead */ public String getConstraintValue(); @@ -48,9 +50,8 @@ public interface XSAttributeUse extends * Value Constraint: Binding specific actual constraint value or * null if the value is in error or there is no value * constraint. - * @exception XSException - * NOT_SUPPORTED_ERR: Raised if the implementation does not support this - * method. + * + * @deprecated Use getValueConstraintValue().getActualValue() instead */ public Object getActualVC() throws XSException; @@ -64,11 +65,9 @@ public interface XSAttributeUse extends * method returns LISTOFUNION_DT. To query the actual * constraint value of the list or list of union type definitions use * itemValueTypes. If the actualNormalizedValue - * is null, this method returns UNAVAILABLE_DT - * . - * @exception XSException - * NOT_SUPPORTED_ERR: Raised if the implementation does not support this - * method. + * is null, this method returns UNAVAILABLE_DT. + * + * @deprecated Use getValueConstraintValue().getActualValueType() instead */ public short getActualVCType() throws XSException; @@ -85,11 +84,18 @@ public interface XSAttributeUse extends * @exception XSException * NOT_SUPPORTED_ERR: Raised if the implementation does not support this * method. + * + * @deprecated Use getValueConstraintValue().getListValueTypes() instead */ public ShortList getItemValueTypes() throws XSException; /** + * The actual value of the default or fixed value constraint. + */ + public XSValue getValueConstraintValue(); + + /** * A sequence of [annotations] or an empty XSObjectList. */ public XSObjectList getAnnotations(); Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSElementDeclaration.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSElementDeclaration.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSElementDeclaration.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSElementDeclaration.java Mon Oct 18 22:08:41 2010 @@ -60,6 +60,8 @@ public interface XSElementDeclaration ex /** * [Value constraint]: the constraint value with respect to the [type * definition], otherwise null. + * + * @deprecated Use getValueConstraintValue().getNormalizedValue() instead */ public String getConstraintValue(); @@ -67,9 +69,8 @@ public interface XSElementDeclaration ex * Value Constraint: Binding specific actual constraint value or * null if the value is in error or there is no value * constraint. - * @exception XSException - * NOT_SUPPORTED_ERR: Raised if the implementation does not support this - * method. + * + * @deprecated Use getValueConstraintValue().getActualValue() instead */ public Object getActualVC() throws XSException; @@ -83,11 +84,9 @@ public interface XSElementDeclaration ex * method returns LISTOFUNION_DT. To query the actual * constraint value of the list or list of union type definitions use * itemValueTypes. If the actualNormalizedValue - * is null, this method returns UNAVAILABLE_DT - * . - * @exception XSException - * NOT_SUPPORTED_ERR: Raised if the implementation does not support this - * method. + * is null, this method returns UNAVAILABLE_DT. + * + * @deprecated Use getValueConstraintValue().getActualValueType() instead */ public short getActualVCType() throws XSException; @@ -101,14 +100,18 @@ public interface XSElementDeclaration ex * for each actual constraint value in the list the array contains the * corresponding memberType kind. For examples, see * ItemPSVI.itemValueTypes. - * @exception XSException - * NOT_SUPPORTED_ERR: Raised if the implementation does not support this - * method. + * + * @deprecated Use getValueConstraintValue().getListValueTypes() instead */ public ShortList getItemValueTypes() throws XSException; /** + * The actual value of the default or fixed value constraint. + */ + public XSValue getValueConstraintValue(); + + /** * If nillable is true, then an element may also be valid if it carries * the namespace qualified attribute with local name nil * from namespace http://www.w3.org/2001/XMLSchema-instance Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSFacet.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSFacet.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSFacet.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSFacet.java Mon Oct 18 22:08:41 2010 @@ -34,6 +34,25 @@ public interface XSFacet extends XSObjec public String getLexicalFacetValue(); /** + * If this facet is length, minLength, maxLength, totalDigits, + * fractionDigits, minScale, or maxScale, and if the value can fit in "int", + * then return the value of the facet as an int. If the value can't fit, + * return -1. Use getActualFacetValue() to get the BigInteger + * representation. For all other facets, return 0. + */ + public int getIntFacetValue(); + + /** + * If this facet is minInclusive, maxInclusive, minExclusive, or + * maxExclusive, then return the actual value of the facet. If this facet + * is length, minLength, maxLength, totalDigits, fractionDigits, minScale, + * or maxScale, then return a BigInteger representation of the value. If + * this facet is whiteSpace or explicitTimezone, then return the String + * representation of the facet. + */ + public Object getActualFacetValue(); + + /** * [Facets]: check whether a facet is fixed. */ public boolean getFixed(); Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSModel.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSModel.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSModel.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSModel.java Mon Oct 18 22:08:41 2010 @@ -41,7 +41,9 @@ public interface XSModel { /** * Returns a list of top-level components, i.e. element declarations, - * attribute declarations, etc. + * attribute declarations, etc. Identity-constraint definitions are also + * considered top-level. + * * @param objectType The type of the declaration, i.e. * ELEMENT_DECLARATION. Note that * XSTypeDefinition.SIMPLE_TYPE and @@ -57,7 +59,9 @@ public interface XSModel { /** * Convenience method. Returns a list of top-level component declarations * that are defined within the specified namespace, i.e. element - * declarations, attribute declarations, etc. + * declarations, attribute declarations, etc. Identity-constraint + * definitions are also considered top-level. + * * @param objectType The type of the declaration, i.e. * ELEMENT_DECLARATION. * @param namespace The namespace to which the declaration belongs or @@ -143,6 +147,17 @@ public interface XSModel { String namespace); /** + * Convenience method. Returns an identity-constraint definition. + * @param name The name of the definition. + * @param namespace The namespace of the definition, otherwise + * null. + * @return An identity-constraint definition or null if such + * a declaration does not exist. + */ + public XSIDCDefinition getIDCDefinition(String name, + String namespace); + + /** * Convenience method. Returns a list containing the members of the * substitution group for the given XSElementDeclaration * or an empty XSObjectList if the substitution group Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSMultiValueFacet.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSMultiValueFacet.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSMultiValueFacet.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSMultiValueFacet.java Mon Oct 18 22:08:41 2010 @@ -19,6 +19,8 @@ package org.apache.xerces.xs; import java.util.Vector; +import org.apache.xerces.xs.datatypes.ObjectList; + /** * Describes a multi-value constraining facets: pattern and enumeration. */ @@ -35,6 +37,11 @@ public interface XSMultiValueFacet exten public StringList getLexicalFacetValues(); /** + * A list of XSValue objects. The actual enumeration values. + */ + public ObjectList getEnumerationValues(); + + /** * A sequence of [annotations] or an empty XSObjectList. */ public XSObjectList getAnnotations(); Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSNamespaceItem.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSNamespaceItem.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSNamespaceItem.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSNamespaceItem.java Mon Oct 18 22:08:41 2010 @@ -30,7 +30,9 @@ public interface XSNamespaceItem { /** * [schema components]: a list of top-level components, i.e. element - * declarations, attribute declarations, etc. + * declarations, attribute declarations, etc. Identity-constraint + * definitions are also considered top-level. + * * @param objectType The type of the declaration, i.e. * ELEMENT_DECLARATION. Note that * XSTypeDefinition.SIMPLE_TYPE and @@ -99,6 +101,14 @@ public interface XSNamespaceItem { public XSNotationDeclaration getNotationDeclaration(String name); /** + * Convenience method. Returns an identity-constraint definition. + * @param name The name of the definition. + * @return An identity-constraint definition or null if such + * a declaration does not exist. + */ + public XSIDCDefinition getIDCDefinition(String name); + + /** * [document location] - a list of location URIs for the documents that * contributed to the XSModel. */ Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java Mon Oct 18 22:08:41 2010 @@ -252,6 +252,11 @@ public interface XSSimpleTypeDefinition public XSObjectList getMultiValueFacets(); /** + * A constraining facet object. An instance of XSFacet or XSMultiValueFacet. + */ + public XSObject getFacet(int facetType); + + /** * A sequence of [annotations] or an empty XSObjectList. */ public XSObjectList getAnnotations(); Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/datatypes/ByteList.java URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/datatypes/ByteList.java?rev=1024040&r1=1024039&r2=1024040&view=diff ============================================================================== --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/datatypes/ByteList.java (original) +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/datatypes/ByteList.java Mon Oct 18 22:08:41 2010 @@ -58,4 +58,8 @@ public interface ByteList extends List { */ public byte item(int index) throws XSException; + /** + * Construct and return a byte array for bytes contained in this list. + */ + public byte[] toByteArray(); } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org For additional commands, e-mail: commits-help@xerces.apache.org