private XSComplexTypeDefinition makeTypeFromAnonymous(XSObject o) { final XSComplexTypeDecl ctd = new XSComplexTypeDecl(); if (o instanceof XSElementDeclaration && ((XSElementDeclaration) o).getTypeDefinition() instanceof XSComplexTypeDecl) { final XSComplexTypeDecl ctd1 = (XSComplexTypeDecl) ((XSElementDeclaration) o).getTypeDefinition(); final XSObjectListImpl annotations = ctd1.getAnnotations() instanceof XSObjectListImpl ? (XSObjectListImpl) ctd1.getAnnotations() : new XSObjectListImpl(); ctd.setValues(o.getName(), ctd1.getNamespace(), ctd1.getBaseType(), ctd1.getDerivationMethod(), ctd1.getFinal(), ctd1.getProhibitedSubstitutions(), ctd1.getContentType(), ctd1.getAbstract(), ctd1.getAttrGrp(), (XSSimpleType) ctd1.getSimpleType(), (XSParticleDecl) ctd1.getParticle(), annotations ); ctd.setName(o.getName() + Util.ANONYMOUS_ELEM_TYPE_SUFFIX); } else if (o instanceof XSAttributeDeclaration) { final XSSimpleTypeDecl ctd1 = (XSSimpleTypeDecl) ((XSAttributeDeclaration) o).getTypeDefinition(); ? (XSObjectListImpl) ctd1.getAnnotations() : new XSObjectListImpl(); ctd.setValues(o.getName(), ctd1.getNamespace(), ctd1.getBaseType(), XSConstants.DERIVATION_RESTRICTION, ctd1.getFinal(), (short) 0, XSComplexTypeDefinition.CONTENTTYPE_SIMPLE, false, new XSAttributeGroupDecl(), ctd1, null, annotations ); ctd.setName(o.getName() + Util.ANONYMOUS_ATTR_TYPE_SUFFIX); new QName(ctd.getNamespace(), ctd.getName()), model.qname2FileMap.get(new QName(o.getNamespace(), o.getName())) );
public void addGlobalComplexTypeDecl(XSComplexTypeDecl decl, String location) { fGlobalTypeDeclsExt.put(((location!=null) ? location : "") + "," + decl.getName(), decl); if (decl.getNamespaceItem() == null) { decl.setNamespaceItem(this); } }
public final XSComplexTypeDecl getComplexTypeDecl(){ int chunk = fCTDeclIndex >> CHUNK_SHIFT; int index = fCTDeclIndex & CHUNK_MASK; ensureCTDeclCapacity(chunk); if (fCTDecl[chunk][index] == null) { fCTDecl[chunk][index] = new XSComplexTypeDecl(); } else { fCTDecl[chunk][index].reset(); } fCTDeclIndex++; return fCTDecl[chunk][index]; }
/** * register one global complex type */ public void addGlobalComplexTypeDecl(XSComplexTypeDecl decl) { fGlobalTypeDecls.put(decl.getName(), decl); decl.setNamespaceItem(this); }
fComplexTypeDecl.setDerivationMethod(XSConstants.DERIVATION_EXTENSION); fComplexTypeDecl.setBaseType(fBaseType); if ((baseType.getFinal() & fDerivedBy)!=0) { fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc); fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc); XSParticleDecl baseContent = (XSParticleDecl)baseType.getParticle(); baseType.getContentType() != XSComplexTypeDecl.CONTENTTYPE_MIXED) { fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc); fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc); throw new ComplexTypeRecoverableError("derivation-ok-restriction.5.4.1.2", new Object[]{fName, baseType.getName()}, complexContent); mergeAttributes(baseType.getAttrGrp(), fAttrGrp, fName, false, complexContent); } catch (ComplexTypeRecoverableError e) { fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc); Object[] errArgs = fAttrGrp.validRestrictionOf(fName, baseType.getAttrGrp(), fSchemaHandler.fXSConstraints); if (errArgs != null) { fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc); fContentType = baseType.getContentType(); fXSSimpleType = (XSSimpleType)baseType.getSimpleType(); fParticle = baseContent; if (fSchemaHandler.fSchemaVersion == Constants.SCHEMA_VERSION_1_1) {
XSComplexTypeDecl annotationType = new XSComplexTypeDecl(); XSComplexTypeDecl documentationType = new XSComplexTypeDecl(); XSComplexTypeDecl appinfoType = new XSComplexTypeDecl(); annotationType.setValues("#AnonType_" + SchemaSymbols.ELT_ANNOTATION, fTargetNamespace, anyType, XSConstants.DERIVATION_RESTRICTION, XSConstants.DERIVATION_NONE, (short) (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION), XSComplexTypeDecl.CONTENTTYPE_ELEMENT, false, annotationAttrs, null, annotationParticle, XSObjectListImpl.EMPTY_LIST, null); annotationType.setName("#AnonType_" + SchemaSymbols.ELT_ANNOTATION); annotationType.setIsAnonymous(); documentationType.setValues("#AnonType_" + SchemaSymbols.ELT_DOCUMENTATION, fTargetNamespace, anyType, XSConstants.DERIVATION_RESTRICTION, XSConstants.DERIVATION_NONE, (short) (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION), XSComplexTypeDecl.CONTENTTYPE_MIXED, false, documentationAttrs, null, anyWCSequenceParticle, XSObjectListImpl.EMPTY_LIST, null); documentationType.setName("#AnonType_" + SchemaSymbols.ELT_DOCUMENTATION); documentationType.setIsAnonymous(); appinfoType.setValues("#AnonType_" + SchemaSymbols.ELT_APPINFO, fTargetNamespace, anyType, XSConstants.DERIVATION_RESTRICTION, XSConstants.DERIVATION_NONE, (short) (XSConstants.DERIVATION_EXTENSION | XSConstants.DERIVATION_RESTRICTION), XSComplexTypeDecl.CONTENTTYPE_MIXED, false, appinfoAttrs, null, anyWCSequenceParticle, XSObjectListImpl.EMPTY_LIST, null); appinfoType.setName("#AnonType_" + SchemaSymbols.ELT_APPINFO); appinfoType.setIsAnonymous();
XSObject context) { fComplexTypeDecl = new XSComplexTypeDecl(); fAttrGrp = new XSAttributeGroupDecl(); Boolean abstractAtt = (Boolean) attrValues[XSAttributeChecker.ATTIDX_ABSTRACT]; fComplexTypeDecl.setName(fName); fTargetNamespace = schemaDoc.fTargetNamespace; fComplexTypeDecl.setBaseType(fBaseType); fComplexTypeDecl.setBaseType(fBaseType); System.out.println(fName); fComplexTypeDecl.setValues(fName, fTargetNamespace, fBaseType, fDerivedBy, fFinal, fBlock, fContentType, fIsAbstract, fAttrGrp, fXSSimpleType, fParticle, new XSObjectListImpl(fAnnotations, fComplexTypeDecl.setContext(context); fComplexTypeDecl.setAssertions(fAssertions != null ? new XSObjectListImpl(fAssertions, fAssertions.length) : null); return fComplexTypeDecl;
/** * Get content model for a given type * * @param typeDecl get content model for which complex type * @return a content model validator */ public XSCMValidator getContentModel(XSComplexTypeDecl typeDecl, boolean forUPA) { // for complex type with empty or simple content, // there is no content model validator short contentType = typeDecl.getContentType(); if (contentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE || contentType == XSComplexTypeDecl.CONTENTTYPE_EMPTY) { return null; } return getContentModel((XSParticleDecl)typeDecl.getParticle(), (XSOpenContentDecl)typeDecl.getOpenContent(), forUPA); }
private void expandRelatedComplexTypeComponents(XSComplexTypeDecl type, Vector componentList, String namespace, Hashtable dependencies) { addRelatedType(type.getBaseType(), componentList, namespace, dependencies); expandRelatedAttributeUsesComponents(type.getAttributeUses(), componentList, namespace, dependencies); final XSParticle particle = type.getParticle(); if (particle != null) { expandRelatedParticleComponents(particle, componentList, namespace, dependencies); } }
void appendTypeInfo(StringBuffer str) { String contentType[] = {"EMPTY", "SIMPLE", "ELEMENT", "MIXED"}; String derivedBy[] = {"EMPTY", "EXTENSION", "RESTRICTION"}; str.append("Complex type name='").append(fTargetNamespace).append(',').append(getTypeName()).append("', "); if (fBaseType != null) { str.append(" base type name='").append(fBaseType.getName()).append("', "); } str.append(" content type='").append(contentType[fContentType]).append("', "); str.append(" isAbstract='").append(getAbstract()).append("', "); str.append(" hasTypeId='").append(containsTypeID()).append("', "); str.append(" final='").append(fFinal).append("', "); str.append(" block='").append(fBlock).append("', "); if (fParticle != null) { str.append(" particle='").append(fParticle.toString()).append("', "); } str.append(" derivedBy='").append(derivedBy[fDerivedBy]).append("'. "); }
if (ctype.getAbstract()) { reportSchemaError("cvc-type.2", new Object[] { element.rawname }); fCurrentCM = ((XSComplexTypeDecl) fCurrentType).getContentModel(fCMBuilder); if (fCurrentType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) { XSComplexTypeDecl ctype = (XSComplexTypeDecl) fCurrentType; attrGrp = ctype.getAttrGrp();
if ( ( (XSComplexTypeDecl) this.element.getTypeDefinition( ) ).getParticle( ) != null ) group = (XSModelGroupImpl) ( (XSComplexTypeDecl) this.element.getTypeDefinition( ) ).getParticle( ) .getTerm( ); if ( ( (XSComplexTypeDecl) this.element.getTypeDefinition( ) ).getAttrGrp( ) != null ) XSAttributeGroupDecl gp1 = ( (XSComplexTypeDecl) this.element.getTypeDefinition( ) ).getAttrGrp( ); XSObjectList list = gp1.getAttributeUses( );
QName arrayType = arrayMapping.get(newComplexTypeElem.getName()); if (arrayType != null) { analyzeType(arrayType, aParams); XSParticle particle = newComplexTypeElem.getParticle();
private List<XSElementDeclaration> getPropertyDecls( XSComplexTypeDecl type ) { List<XSElementDeclaration> propDecls = new ArrayList<XSElementDeclaration>(); getPropertyDecls( type.getParticle(), propDecls ); return propDecls; }
else if ((((XSComplexTypeDecl)parent).getDerivationMethod() != XSConstants.DERIVATION_RESTRICTION) || (((XSComplexTypeDecl)parent).getBaseType() == SchemaGrammar.getXSAnyType(fSchemaHandler.fSchemaVersion))) { reportSchemaError ("src-element.4.3.2", new Object[] {nameAtt}, elmDecl); ((XSSimpleType)elementType).isIDType()) || (elementType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE && ((XSComplexTypeDecl)elementType).containsTypeID())) { reportSchemaError ("e-props-correct.5", new Object[]{element.fName}, elmDecl); element.fDefault = null;
((XSComplexTypeDecl)type.getBaseType()).setContext(type); if (grammar.getGlobalTypeDecl(type.getName()) == null) { grammar.addGlobalComplexTypeDecl(type); final XSTypeDefinition type2 = grammar.getGlobalTypeDecl(type.getName(), loc); if (type2 == null) { grammar.addGlobalComplexTypeDecl(type, loc);
else if ((enclCT.getDerivationMethod() != XSConstants.DERIVATION_RESTRICTION) || enclCT.getBaseType() == SchemaGrammar.getXSAnyType(fSchemaHandler.fSchemaVersion)) { reportSchemaError ("src-attribute.6.3.2", new Object[] {nameAtt}, attrDecl);
public boolean canHaveRemoteValue() { if (this.type.getTypeCategory() == 14) { return true; } XSComplexTypeDecl complexType = (XSComplexTypeDecl) this.type; XSAttributeGroupDefinition attributeGroupDefinition = complexType .getAttrGrp(); if (attributeGroupDefinition == null) { return false; } XSObjectList attrUses = attributeGroupDefinition.getAttributeUses(); for (int ii = 0; ii < attrUses.getLength(); ii++) { XSAttributeUse attrUse = (XSAttributeUse) attrUses.item(ii); XSAttributeDeclaration attrDecl = attrUse.getAttrDeclaration(); if ((attrDecl.getName().equals("href")) && (attrDecl.getNamespace() != null) && (attrDecl.getNamespace() .equals("http://www.w3.org/1999/xlink"))) { return true; } } return false; }
if (elementTypeInfo instanceof XSComplexTypeDecl) { XSComplexTypeDecl typeInfo = (XSComplexTypeDecl) elementTypeInfo; baseType = typeInfo.getBaseType(); annotations = typeInfo.getAnnotations(); } else { XSSimpleTypeDecl typeInfo = (XSSimpleTypeDecl) elementTypeInfo;
if (((XSComplexTypeDecl) type).getDerivationMethod() != XSConstants.DERIVATION_RESTRICTION) { return false;