private boolean isTypeDerivedFromSTList(XSSimpleTypeDefinition simpleTypeDefn) { return ((XSSimpleType) simpleTypeDefn.getBaseType()).getVariety() == XSSimpleType.VARIETY_LIST; }
private boolean isTypeDerivedFromSTUnion(XSSimpleTypeDefinition simpleTypeDefn) { return ((XSSimpleType) simpleTypeDefn.getBaseType()).getVariety() == XSSimpleType.VARIETY_UNION; }
private void exportSimpleType( XMLStreamWriter writer, XSSimpleTypeDefinition simple ) throws XMLStreamException { writer.writeStartElement( "simpleType" ); if ( !simple.getAnonymous() ) { writer.writeAttribute( "name", simple.getName() ); } // TODO how can one find the derivation type? getFinal() is wrong! LOG.debug( "Exporting a simple type is done always by restriction. Other derivations may be possible?!" ); writer.writeStartElement( "restriction" ); QName qName = new QName( simple.getBaseType().getNamespace(), simple.getBaseType().getName() ); writer.writeAttribute( "base", getPrefixedName( qName ) ); StringList members = simple.getLexicalEnumeration(); if ( members != null && members.getLength() > 0 ) { for ( int i = 0; i < members.getLength(); i++ ) { writer.writeEmptyElement( "enumeration" ); writer.writeAttribute( "value", members.item( i ) ); } } writer.writeEndElement(); // derivation (restriction, extension, etc.) writer.writeEndElement(); // simpleType }
String toString( XSSimpleTypeDefinition simpleType ) { String s = "\n - simple type: '" + simpleType.getName() + "' (" + simpleType.getNamespace() + ")"; XSTypeDefinition baseType = simpleType.getBaseType(); if ( baseType != null ) { s += "\n - type hierarchy:"; s += generateTypeHierarchy( baseType, " " ); } return s; }
XSSimpleTypeDefinition simpleType = (XSSimpleTypeDefinition)type; while(!Namespaces.URI_XSD.equals(simpleType.getNamespace())) simpleType = (XSSimpleTypeDefinition)simpleType.getBaseType(); if("base64Binary".equals(simpleType.getName())){ try{
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
builtInType = (XSSimpleTypeDefinition) builtInType.getBaseType();
(XSSimpleTypeDefinition)type.getBaseType(), value, attrs );
setXDMTypedValueOf$valueForSTVarietyList(fRootNodeOfAssertTree, value, simpleContentTypeForUnion, ((XSSimpleTypeDefinition)simpleContentTypeForUnion.getBaseType()).getVariety() == XSSimpleTypeDefinition.VARIETY_LIST, xpath2DynamicContext);
XSTypeDefinition base = simple.getBaseType(); while (!Constants.NS_SCHEMA_XSD.equals(base.getNamespace())) base = base.getBaseType();
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); } } }
XSTypeDefinition baseTypeDef = type.getBaseType(); TypeBinding baseType = baseTypeDef == null ? null : bindType(baseTypeDef);
addComponent(((XSSimpleTypeDefinition)sourceComponent).getBaseType(), nameTest, targetComponents); addComponent(((XSSimpleTypeDefinition)sourceComponent).getPrimitiveType(),