public Object getImmediateNode() { // first try regular way PropertyType pt = descriptor.getType(); if (pt instanceof ComplexType) { ComplexType ct = (ComplexType) pt; PropertyDescriptor ad = ct.getDescriptor("@" + name.getLocalPart()); if (ad != null) { return ad; } } XSDElementDeclaration decl = (XSDElementDeclaration) descriptor.getUserData().get(XSDElementDeclaration.class); Iterator it = Schemas.getAttributeDeclarations(decl).iterator(); while (it.hasNext()) { XSDAttributeDeclaration attDecl = ((XSDAttributeDeclaration) it.next()); if (attDecl.getURI() .equals( (name.getNamespaceURI() == null ? "" : name.getNamespaceURI()) + "#" + name.getLocalPart())) { return name; } } return null; }
public Object getImmediateNode() { XSDElementDeclaration decl = (XSDElementDeclaration) descriptor.getUserData().get(XSDElementDeclaration.class); Iterator it = Schemas.getAttributeDeclarations(decl).iterator(); while (it.hasNext()) { XSDAttributeDeclaration attDecl = ((XSDAttributeDeclaration) it.next()); if ( attDecl.getURI().equals((name.getNamespaceURI()==null?"":name.getNamespaceURI()) + "#" + name.getLocalPart() )) { return name; } } return null; }
protected static Map<String, XSDAttributeDeclaration> getProhibitedAttributes(Collection<XSDAttributeGroupContent> xsdAttributeContents) { Map<String, XSDAttributeDeclaration> result = new HashMap<String, XSDAttributeDeclaration>(); for (XSDAttributeGroupContent xsdAttributeGroupContent : xsdAttributeContents) { if (xsdAttributeGroupContent instanceof XSDAttributeGroupDefinition) { XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition)xsdAttributeGroupContent; result.putAll(getProhibitedAttributes(xsdAttributeGroupDefinition.getContents())); } else { XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)xsdAttributeGroupContent; if (xsdAttributeUse.getUse() == XSDAttributeUseCategory.PROHIBITED_LITERAL) { XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration(); result.put(xsdAttributeDeclaration.getURI(), xsdAttributeDeclaration); } } } return result; }
protected static Map<String, XSDAttributeDeclaration> getProhibitedAttributes(Collection<XSDAttributeGroupContent> xsdAttributeContents) { Map<String, XSDAttributeDeclaration> result = new HashMap<String, XSDAttributeDeclaration>(); for (XSDAttributeGroupContent xsdAttributeGroupContent : xsdAttributeContents) { if (xsdAttributeGroupContent instanceof XSDAttributeGroupDefinition) { XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition)xsdAttributeGroupContent; result.putAll(getProhibitedAttributes(xsdAttributeGroupDefinition.getContents())); } else { XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)xsdAttributeGroupContent; if (xsdAttributeUse.getUse() == XSDAttributeUseCategory.PROHIBITED_LITERAL) { XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration(); result.put(xsdAttributeDeclaration.getURI(), xsdAttributeDeclaration); } } } return result; }
public Object getImmediateNode() { // first try regular way PropertyType pt = descriptor.getType(); if (pt instanceof ComplexType) { ComplexType ct = (ComplexType) pt; PropertyDescriptor ad = ct.getDescriptor("@" + name.getLocalPart()); if (ad != null) { return ad; } } XSDElementDeclaration decl = (XSDElementDeclaration) descriptor.getUserData().get(XSDElementDeclaration.class); Iterator it = Schemas.getAttributeDeclarations(decl).iterator(); while (it.hasNext()) { XSDAttributeDeclaration attDecl = ((XSDAttributeDeclaration) it.next()); if (attDecl.getURI() .equals( (name.getNamespaceURI() == null ? "" : name.getNamespaceURI()) + "#" + name.getLocalPart())) { return name; } } return null; }
(XSDDiagnosticSeverity.ERROR_LITERAL, "derivation-ok-restriction.2.1.2", xsdAttributeDeclaration.getURI(), baseXSDAttributeDeclaration.getTypeDefinition().getURI()); (XSDDiagnosticSeverity.ERROR_LITERAL, "derivation-ok-restriction.2.1.1", xsdAttributeDeclaration.getURI()); (XSDDiagnosticSeverity.ERROR_LITERAL, "derivation-ok-restriction.2.2", xsdAttributeDeclaration.getURI()); (XSDDiagnosticSeverity.ERROR_LITERAL, "derivation-ok-restriction.3", baseXSDAttributeUse.getAttributeDeclaration().getURI());
(XSDDiagnosticSeverity.ERROR_LITERAL, "derivation-ok-restriction.2.1.2", xsdAttributeDeclaration.getURI(), baseXSDAttributeDeclaration.getTypeDefinition().getURI()); (XSDDiagnosticSeverity.ERROR_LITERAL, "derivation-ok-restriction.2.1.1", xsdAttributeDeclaration.getURI()); (XSDDiagnosticSeverity.ERROR_LITERAL, "derivation-ok-restriction.2.2", xsdAttributeDeclaration.getURI()); (XSDDiagnosticSeverity.ERROR_LITERAL, "derivation-ok-restriction.3", baseXSDAttributeUse.getAttributeDeclaration().getURI());
niceSetAttributeURIValue(theElement, XSDConstants.REF_ATTRIBUTE, theResolvedAttributeDeclaration.getURI());
niceSetAttributeURIValue(theElement, XSDConstants.REF_ATTRIBUTE, theResolvedAttributeDeclaration.getURI());
(XSDDiagnosticSeverity.ERROR_LITERAL, "_UI_UnresolvedAttributeDeclaration_message", theResolvedAttributeDeclaration.getURI());
(XSDDiagnosticSeverity.ERROR_LITERAL, "_UI_UnresolvedAttributeDeclaration_message", theResolvedAttributeDeclaration.getURI());
(XSDDiagnosticSeverity.ERROR_LITERAL, "cos-ct-extends.1.2.2", xsdAttributeDeclaration.getURI(), baseXSDAttributeDeclaration.getTypeDefinition().getURI()); (XSDDiagnosticSeverity.ERROR_LITERAL, "cos-ct-extends.1.2.1", baseXSDAttributeDeclaration.getURI()); String uri = xsdAttributeDeclaration.getURI(); if (prohibitedAttributeURIs != null && prohibitedAttributeURIs.containsKey(uri)) (XSDDiagnosticSeverity.ERROR_LITERAL, "ct-props-correct.5", xsdAttributeDeclaration.getURI(), idAttribute.getURI());
(XSDDiagnosticSeverity.ERROR_LITERAL, "cos-ct-extends.1.2.2", xsdAttributeDeclaration.getURI(), baseXSDAttributeDeclaration.getTypeDefinition().getURI()); (XSDDiagnosticSeverity.ERROR_LITERAL, "cos-ct-extends.1.2.1", baseXSDAttributeDeclaration.getURI()); String uri = xsdAttributeDeclaration.getURI(); if (prohibitedAttributeURIs != null && prohibitedAttributeURIs.containsKey(uri)) (XSDDiagnosticSeverity.ERROR_LITERAL, "ct-props-correct.5", xsdAttributeDeclaration.getURI(), idAttribute.getURI());