public void visit(XSDParticle particle) { XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent(); if (decl.isElementDeclarationReference()) { decl = decl.getResolvedElementDeclaration(); } if (decl == fElement) { if (particle.isSetMaxOccurs()) { maxOccurs.add(Integer.valueOf(particle.getMaxOccurs())); } else if (particle.getContainer() instanceof XSDModelGroup && particle.getContainer().getContainer() instanceof XSDParticle) { particle = (XSDParticle) particle.getContainer().getContainer(); maxOccurs.add(Integer.valueOf(particle.getMaxOccurs())); } else { maxOccurs.add(1); } } } };
public void visit(XSDParticle particle) { XSDElementDeclaration decl = (XSDElementDeclaration) particle.getContent(); if (decl.isElementDeclarationReference()) { decl = decl.getResolvedElementDeclaration(); } if (decl == fElement) { if (particle.isSetMinOccurs()) { minOccurs.add(Integer.valueOf(particle.getMinOccurs())); } else if (particle.getContainer() instanceof XSDModelGroup && particle.getContainer().getContainer() instanceof XSDParticle) { particle = (XSDParticle) particle.getContainer().getContainer(); minOccurs.add(Integer.valueOf(particle.getMinOccurs())); } else { minOccurs.add(1); } } } };
public void validateRoot() { XSDConcreteComponent diagnosticTarget = this; XSDParticle xsdParticle; if (getContainer() instanceof XSDParticle) { xsdParticle = (XSDParticle)getContainer(); if (xsdParticle.eContainmentFeature() == XSDPackage.Literals.XSD_COMPLEX_TYPE_DEFINITION__SYNTHETIC_PARTICLE) { diagnosticTarget = xsdParticle.getContainer(); } } else { xsdParticle = XSDFactory.eINSTANCE.createXSDParticle(); xsdParticle.setTerm(this); } XSDParticleImpl.XSDNFA dfa = (XSDParticleImpl.XSDNFA)xsdParticle.getDFA(); Collection<XSDDiagnostic> diagnostics = dfa.getDiagnostics(); if (!diagnostics.isEmpty()) { for (XSDDiagnostic xsdDiagnostic : diagnostics) { xsdDiagnostic.setPrimaryComponent(diagnosticTarget); xsdDiagnostic.setNode(diagnosticTarget.getElement()); } getDiagnostics().addAll(diagnostics); } }
public void validateRoot() { XSDConcreteComponent diagnosticTarget = this; XSDParticle xsdParticle; if (getContainer() instanceof XSDParticle) { xsdParticle = (XSDParticle)getContainer(); if (xsdParticle.eContainmentFeature() == XSDPackage.Literals.XSD_COMPLEX_TYPE_DEFINITION__SYNTHETIC_PARTICLE) { diagnosticTarget = xsdParticle.getContainer(); } } else { xsdParticle = XSDFactory.eINSTANCE.createXSDParticle(); xsdParticle.setTerm(this); } XSDParticleImpl.XSDNFA dfa = (XSDParticleImpl.XSDNFA)xsdParticle.getDFA(); Collection<XSDDiagnostic> diagnostics = dfa.getDiagnostics(); if (!diagnostics.isEmpty()) { for (XSDDiagnostic xsdDiagnostic : diagnostics) { xsdDiagnostic.setPrimaryComponent(diagnosticTarget); xsdDiagnostic.setNode(diagnosticTarget.getElement()); } getDiagnostics().addAll(diagnostics); } }
XSDModelGroup modelGroup = (XSDModelGroup) ((XSDParticle) parent).getContainer(); XSDModelGroup modelGroup = (XSDModelGroup) ((XSDParticle) parent).getContainer(); modelGroup.getContents().remove(parent);