public ItemPSVI constant() { if (isConstant()) { return this; } return new AttributePSVImpl(true, this); }
attrPSVI = (AttributePSVImpl) augs.getItem(Constants.ATTRIBUTE_PSVI); if (attrPSVI != null) { attrPSVI.reset(); } else { attrPSVI = new AttributePSVImpl(); augs.putItem(Constants.ATTRIBUTE_PSVI, attrPSVI);
public ItemPSVI constant() { return new AttributePSVImpl(true, this); }
private XSObjectListImpl getAssertsFromAttributes(XMLAttributes attributes) { XSObjectListImpl attrAssertList = new XSObjectListImpl(); List xsTypeList = new ArrayList(); for (int attrIndx = 0; attrIndx < attributes.getLength(); attrIndx++) { Augmentations attrAugs = attributes.getAugmentations(attrIndx); AttributePSVImpl attrPSVI = (AttributePSVImpl) attrAugs.getItem(Constants.ATTRIBUTE_PSVI); XSSimpleTypeDefinition attrType = (XSSimpleTypeDefinition) attrPSVI.getTypeDefinition(); if (attrType != null && !XS11TypeHelper.isListContainsType(xsTypeList, attrType)) { // since different attributes may be validated by the same type, so we deduplicate the type list here // to only store unique assertions. xsTypeList.add(attrType); List attrAsserts = getAssertsFromSimpleType(attrType); // copy assertions to the parent list if (attrAsserts != null) { for (Iterator iter = attrAsserts.iterator(); iter.hasNext();) { attrAssertList.addXSObject((XSAssertImpl)iter.next()); } } } } return attrAssertList; } // getAssertsFromAttributes
AttributePSVImpl attrPSVI = new AttributePSVImpl(); augs.putItem(Constants.ATTRIBUTE_PSVI, attrPSVI);
void extraCheckForSTUnionAssertsAttrs(XMLAttributes attributes) { XMLAttributes attrsImpl = (XMLAttributesImpl)attributes; for (int attrIdx = 0; attrIdx < attrsImpl.getLength(); attrIdx++) { Augmentations attrAugs = attrsImpl.getAugmentations(attrIdx); AttributePSVImpl attrPsvi = (AttributePSVImpl)attrAugs.getItem(Constants.ATTRIBUTE_PSVI); XSSimpleTypeDefinition attrSimpleType = (XSSimpleTypeDefinition) attrPsvi.getTypeDefinition(); List isAssertProcessingNeededForSTUnionAttrs = fXmlSchemaValidator.getIsAssertProcessingNeededForSTUnionAttrs(); if (attrSimpleType != null && attrSimpleType.getVariety() == XSSimpleTypeDefinition.VARIETY_UNION && ((XSSimpleType) attrSimpleType.getBaseType()).getVariety() != XSSimpleTypeDefinition.VARIETY_UNION) { if (XS11TypeHelper.isAtomicStrValueValidForSTUnion(attrSimpleType.getMemberTypes(), attrsImpl.getValue(attrIdx), attrPsvi.fValue, Constants.SCHEMA_VERSION_1_1)) { isAssertProcessingNeededForSTUnionAttrs.add(Boolean.valueOf(false)); } else { isAssertProcessingNeededForSTUnionAttrs.add(Boolean.valueOf(true)); } } else { isAssertProcessingNeededForSTUnionAttrs.add(Boolean.valueOf(true)); } } } // extraCheckForSTUnionAssertsAttrs
private void evaluateAssertsFromAttributes(QName element, XMLAttributes attributes) throws Exception { for (int attrIdx = 0; attrIdx < attributes.getLength(); attrIdx++) { QName attrQname = new QName(); attributes.getName(attrIdx, attrQname); String attrValue = attributes.getValue(attrIdx); Augmentations attrAugs = attributes.getAugmentations(attrIdx); AttributePSVImpl attrPsvi = (AttributePSVImpl)attrAugs.getItem(Constants.ATTRIBUTE_PSVI); XSSimpleTypeDefinition attrSimpleType = (XSSimpleTypeDefinition) attrPsvi.getTypeDefinition(); if (attrSimpleType != null) { List attrAssertList = fXmlSchemaValidator.getAssertionValidator().getAssertsFromSimpleType(attrSimpleType); if (attrAssertList != null) { boolean isTypeDerivedFromList = isTypeDerivedFromSTList(attrSimpleType); boolean isTypeDerivedFromUnion = isTypeDerivedFromSTUnion(attrSimpleType); for (int assertIdx = 0; assertIdx < attrAssertList.size(); assertIdx++) { XSAssertImpl assertImpl = (XSAssertImpl)attrAssertList.get(assertIdx); assertImpl.setAttrName(attrQname.localpart); evaluateOneAssertionFromSimpleType(element, attrValue, attrAugs, attrSimpleType, isTypeDerivedFromList, isTypeDerivedFromUnion, assertImpl, true, attrQname); // evaluate assertions on itemType of xs:list XSSimpleTypeDefinition attrItemType = attrSimpleType.getItemType(); if (isTypeDerivedFromList && attrItemType != null) { evaluateAssertsFromItemTypeOfSTList(element, attrItemType, attrValue); } } } } } } // evaluateAssertsFromAttributes