public XSSimpleTypeDefinition getItemType() { return xsSimple.getItemType(); }
public TypeDefinition getItemType() { return createTypeDefinition(simpleTypeDefinition.getItemType()); }
/** * Checks if a type is derived from another by list. See: * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom * * @param ancestorNS * The namspace of the ancestor type declaration * @param ancestorName * The name of the ancestor type declaration * @param type * The reference type definition * * @return boolean True if the type is derived by list for the reference type */ private boolean isDerivedByList (String ancestorNS, String ancestorName, XSTypeDefinition type) { // If the variety is union if (type !=null && ((XSSimpleTypeDefinition)type).getVariety() == VARIETY_LIST) { // get the {item type} XSTypeDefinition itemType = ((XSSimpleTypeDefinition)type).getItemType(); // T2 is the {item type definition} if (itemType != null) { // T2 is derived from the other type definition by DERIVATION_RESTRICTION if (isDerivedByRestriction(ancestorNS, ancestorName, itemType)) { return true; } } } return false; }
private void evaluateAssertionsFromASimpleType(QName element, List assertions, String value, Augmentations augs) throws Exception { XSSimpleTypeDefinition simpleTypeDefn = (XSSimpleTypeDefinition) ((ElementPSVI) augs.getItem(Constants.ELEMENT_PSVI)).getTypeDefinition(); boolean isTypeDerivedFromList = isTypeDerivedFromSTList(simpleTypeDefn); boolean isTypeDerivedFromUnion = isTypeDerivedFromSTUnion(simpleTypeDefn); Vector assertList = (Vector) assertions; for (int assertIdx = 0; assertIdx < assertList.size(); assertIdx++) { XSAssertImpl assertImpl = (XSAssertImpl) assertList.get(assertIdx); String xPathDefaultNamespace = assertImpl.getXPathDefaultNamespace(); if (xPathDefaultNamespace != null) { fXpath2DynamicContext.add_namespace(null, xPathDefaultNamespace); } evaluateOneAssertionFromSimpleType(element, value, augs, simpleTypeDefn, isTypeDerivedFromList, isTypeDerivedFromUnion, assertImpl, false, null); } // evaluate assertions on itemType of xs:list if (isTypeDerivedFromList && simpleTypeDefn.getItemType() != null) { evaluateAssertsFromItemTypeOfSTList(element, simpleTypeDefn.getItemType(), value); } } // evaluateAssertionsFromASimpleType
if (facetList.getLength() == 0 && simpleTypeDef.getItemType() != null) { facetList = (XSObjectListImpl) simpleTypeDef.getItemType().getMultiValueFacets();
public static String generateSampleValue(GeneratorConfig config, XSSimpleTypeDefinition simpleType, String hint, Map<String, Integer> counters) { if (simpleType.getBuiltInKind() == XSConstants.LIST_DT) { XSSimpleTypeDefinition itemType = simpleType.getItemType();
if(type.getItemType() != null) XSSimpleTypeDefinition itemType = type.getItemType(); if(Constants.NS_XML_SCHEMA.equals(itemType.getNamespace()))
if(SimpleTypeBindings.XS_QNAME_NAME.equals(typeName) || SimpleTypeBindings.XS_NOTATION_NAME.equals(typeName) || type.getItemType() != null && (SimpleTypeBindings.XS_QNAME_NAME.equals(type.getItemType().getName()) || SimpleTypeBindings.XS_NOTATION_NAME.equals(type.getItemType().getName())
while (listStrTokens.hasMoreTokens()) { String itemValue = listStrTokens.nextToken(); if (listOrUnionType.getItemType() != null) { xdmItemList.add(SchemaTypeValueFactory.newSchemaTypeValue((listOrUnionType.getItemType()).getBuiltInKind(), itemValue));
if (complexTypeSimplContentType.getVariety() == XSSimpleTypeDefinition.VARIETY_LIST) { XSSimpleTypeDefinition listItemType = complexTypeSimplContentType.getItemType();
if(attrType.getItemType() != null) XSSimpleTypeDefinition itemType = attrType.getItemType(); if(Constants.NS_XML_SCHEMA.equals(itemType.getNamespace())) if(attrs == null && (SimpleTypeBindings.XS_QNAME_NAME.equals(typeName) || SimpleTypeBindings.XS_NOTATION_NAME.equals(typeName) || simpleType.getItemType() != null && (SimpleTypeBindings.XS_QNAME_NAME.equals(simpleType.getItemType().getName()) || SimpleTypeBindings.XS_NOTATION_NAME.equals(simpleType.getItemType().getName())
XSSimpleTypeDefinition itemType = xsSimpleType.getItemType(); QName xmlBaseType = new QName(itemType.getNamespace(), itemType.getName()); javaTypeName = new LiteralTypeMapping().getJavaTypeName(xmlBaseType);
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
Vector baseItemTypeAsserts = XS11TypeHelper.getAssertsFromSimpleType(((XSSimpleTypeDefinition)complexTypeDef.getBaseType()).getItemType()); for (int assertIdx = 0; assertIdx < baseItemTypeAsserts.size(); assertIdx++) { complexTypeAsserts.addXSObject((XSAssert) baseItemTypeAsserts.get(assertIdx));
return handleSimpleType(simple.getItemType()); case XSSimpleTypeDefinition.VARIETY_UNION: XSObjectList list = simple.getMemberTypes();
evaluateAssertionOnSTListValue(element, value, assertImpl, false, simpleTypeDefn.getItemType(), isTypeDerivedFromList);
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(type.getItemType() != null) TypeBinding itemType = bindSimpleType(type.getItemType()); binding.setItemType(itemType);
savePsviInfoWithUntypingOfAssertRoot(elemPsvi, true); XSSimpleTypeDefinition listItemType = simpleTypeDefn.getItemType(); if (isTypeDerivedFromList && listItemType != null) { restorePsviInfoForXPathContext(elemPsvi);
addComponent(((XSSimpleTypeDefinition)sourceComponent).getPrimitiveType(), nameTest, targetComponents); addComponent(((XSSimpleTypeDefinition)sourceComponent).getItemType(), nameTest, targetComponents); XSObjectList list = ((XSSimpleTypeDefinition)sourceComponent).getMemberTypes();