private void expandRelatedAttributeUsesComponents(XSObjectList attrUses, Vector componentList, String namespace, Hashtable dependencies) { final int attrUseSize = (attrUses == null) ? 0 : attrUses.size(); for (int i=0; i<attrUseSize; i++) { expandRelatedAttributeUseComponents((XSAttributeUse)attrUses.item(i), componentList, namespace, dependencies); } }
for (int assertLstIdx = 0; assertLstIdx < assertList.size(); assertLstIdx++) { if (!assertExists((XSAssertImpl) assertList.get(assertLstIdx))) { addAssertion((XSAssertImpl) assertList.get(assertLstIdx)); for (int facetIdx = 0; facetIdx < facets.getLength(); facetIdx++) { XSMultiValueFacet facet = (XSMultiValueFacet) facets.item(facetIdx); if (facet.getFacetKind() == XSSimpleTypeDefinition.FACET_ASSERT) { Vector assertionFacets = facet.getAsserts();
/** * Optional. Annotation. */ public XSAnnotation getAnnotation() { return (fAnnotations != null) ? (XSAnnotation) fAnnotations.item(0) : null; }
if (item2.getAbstract()) { XSObjectList substitutionGroup = xsModel.getSubstitutionGroup(item2); if (!(substitutionGroup.getLength() == 0)) { int rand = RandomUtil.random(0, substitutionGroup.getLength() - 1); stack.push(new StackItem(substitutionGroup.item(rand), item)); added = true; for (int i = 0; i < complexType.getAttributeUses().getLength(); i++) { stack.push(new StackItem(complexType.getAttributeUses().get(i), item)); if (group.getCompositor() == XSModelGroup.COMPOSITOR_CHOICE) { XSObjectList particles = group.getParticles(); int count = particles.getLength(); if (!config.generateAllChoices && !particle.getMaxOccursUnbounded()) { count = Math.min(count, particle.getMaxOccurs()); List<XSParticle> list = new ArrayList<>(particles.getLength()); List<XSParticle> listNo = new ArrayList<>(particles.getLength()); for (int i = 0; i < particles.getLength(); i++) { XSParticle p = (XSParticle) particles.item(i); if (definition.containsKey(p.getTerm().getName())) { list.add(p); for (int i = 0; i < particles.getLength(); i++) { list.add((XSParticle) particles.item(i)); if (modelGroup.getCompositor() == XSModelGroup.COMPOSITOR_ALL) { XSObjectList particles = modelGroup.getParticles();
XSModelGroup modelGroup = (XSModelGroup)term; if(modelGroup.getParticles().getLength() > 0)
if (((XSTypeDefinition)comp).getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) { XSObjectList memberTypes = ((XSSimpleTypeDefinition)comp).getMemberTypes(); for (int j = 0, nt = memberTypes.size(); j < nt; ++j) { addComponent((XSObject)memberTypes.get(j), step.getNametest(), result); for (int j = 0, na = attribUses.size(); j < na; ++j) { addComponent((XSObject)attribUses.get(j), step.getNametest(), result); if (comp.getType() == XSConstants.MODEL_GROUP) { XSObjectList particles = ((XSModelGroup)comp).getParticles(); for (int j = 0, np = particles.size(); j < np; ++j) { addComponent((XSObject) particles.get(j), step.getNametest(), result);
private List<XSParticle> getAllElementParticles( XSParticle particle ) { List<XSParticle> particles = new ArrayList<XSParticle>(); XSTerm xsTerm = particle.getTerm(); switch ( xsTerm.getType() ) { case XSConstants.ELEMENT_DECLARATION: particles.add( particle ); break; case XSConstants.MODEL_GROUP: XSModelGroup group = (XSModelGroup) xsTerm; for ( Iterator<XSParticle> itr = group.getParticles().iterator(); itr.hasNext(); ) { XSParticle xsParticle = itr.next(); particles.addAll( getAllElementParticles( xsParticle ) ); } break; default: // ignore wildcard term } return particles; }
/** * Optional. Annotation. */ public XSAnnotation getAnnotation() { return (XSAnnotation) annotations.item(0); }
private void expandRelatedSimpleTypeComponents(XSSimpleTypeDefinition type, Vector componentList, String namespace, Hashtable dependencies) { final XSTypeDefinition baseType = type.getBaseType(); if (baseType != null) { addRelatedType(baseType, componentList, namespace, dependencies); } final XSTypeDefinition itemType = type.getItemType(); if (itemType != null) { addRelatedType(itemType, componentList, namespace, dependencies); } final XSTypeDefinition primitiveType = type.getPrimitiveType(); if (primitiveType != null) { addRelatedType(primitiveType, componentList, namespace, dependencies); } final XSObjectList memberTypes = type.getMemberTypes(); if (memberTypes.size() > 0) { for (int i=0; i<memberTypes.size(); i++) { addRelatedType((XSTypeDefinition)memberTypes.item(i), componentList, namespace, dependencies); } } }
if (memberTypes != null && memberTypes.getLength() > 0 && !isTypeDerivedFromUnion) { if (isValidationFailedForSTUnion(memberTypes, element, value, augs)) { isValueValid = false;
/** * Optional. Annotation. */ public XSAnnotation getAnnotation() { return (fAnnotations != null) ? (XSAnnotation) fAnnotations.item(0) : null; }
private void addTopLevelComponents(QName nameTest) { // get the annotations() components XSObjectList annotations = xsModel.getAnnotations(); for (int i = 0, n = annotations.size(); i < n; ++i) { addComponent(annotations.item(i), nameTest, result); } final short[] SCHEMA_COMPONENTS = new short[] { XSConstants.ELEMENT_DECLARATION, XSConstants.TYPE_DEFINITION, XSConstants.ATTRIBUTE_DECLARATION, XSConstants.ATTRIBUTE_GROUP, XSConstants.MODEL_GROUP_DEFINITION, XSConstants.NOTATION_DECLARATION, // XSConstants.IDENTITY_CONSTRAINT // TODO: return empty. we don't support IDC at top level }; XSNamedMap map; for (int i = 0; i < SCHEMA_COMPONENTS.length; ++i) { map = xsModel.getComponents(SCHEMA_COMPONENTS[i]); if (!map.isEmpty()) { for (int j = 0, n =map.size(); j < n; ++j) { addComponent(map.item(i), nameTest, result); } } } } // getTopLevelComponents()
private XSSimpleTypeDefinition getActualXDMItemTypeForSTVarietyUnion(XSObjectList memberTypes, String xdmItemStrValue) { XSSimpleTypeDefinition xdmItemType = null; // iterate the member types of union in order, to find that which schema type can successfully validate an atomic value first final int memberTypesLength = memberTypes.getLength(); for (int memTypeIdx = 0; memTypeIdx < memberTypesLength; memTypeIdx++) { XSSimpleType memSimpleType = (XSSimpleType) memberTypes.item(memTypeIdx); if (XS11TypeHelper.isStrValueValidForASimpleType(xdmItemStrValue, memSimpleType, Constants.SCHEMA_VERSION_1_1)) { // no more memberTypes need to be checked xdmItemType = memSimpleType; break; } } return xdmItemType; } // getActualXDMItemTypeForSTVarietyUnion
/** * Optional. Annotation. */ public XSAnnotation getAnnotation() { return (fAnnotations != null) ? (XSAnnotation) fAnnotations.item(0) : null; }