public XSDTypeDefinition getTypeDefinition() { return decl.getTypeDefinition(); }
type = ((XSDAttributeDeclaration)named).getTypeDefinition(); desc = "attribute";
XSDSimpleTypeDefinition type = attribute.getTypeDefinition(); if (type == null) { if (Utilities.equals(ad.getTargetNamespace(), attribute.getTargetNamespace()) && Utilities.equals(ad.getName(), attribute.getName())) { type = ad.getTypeDefinition(); break;
public XSDTypeDefinition getTypeDefinition() { return decl.getTypeDefinition(); }
public XSDTypeDefinition getTypeDefinition() { return decl.getTypeDefinition(); }
public XSDTypeDefinition getTypeDefinition() { return decl.getTypeDefinition(); }
attribute = attribute.getResolvedAttributeDeclaration(); XSDSimpleTypeDefinition type = attribute.getTypeDefinition(); if (type == null) { attribute.getTargetNamespace()) && Utilities.equals(ad.getName(), attribute.getName())) { type = ad.getTypeDefinition(); break;
public String getTypeNameQualifier() { XSDAttributeDeclaration attr = getResolvedXSDAttributeDeclaration(); if (attr != null) { if (attr.getTypeDefinition() != null) { return attr.getTypeDefinition().getTargetNamespace(); } } return null; }
public String getTypeNameQualifier() { XSDTypeDefinition type = getResolvedXSDAttributeDeclaration().getTypeDefinition(); if (type != null) { return type.getTargetNamespace(); } return ""; }
public String getTypeNameQualifier() { XSDTypeDefinition type = getResolvedXSDAttributeDeclaration().getTypeDefinition(); if (type != null) { return type.getTargetNamespace(); } return ""; }
public String getTextForAttribute(XSDAttributeDeclaration ad, boolean showType) { ad = ad.getResolvedAttributeDeclaration(); String name = ad.getName(); StringBuffer result = new StringBuffer(); if (name == null) { result.append(" " + Messages._UI_LABEL_ABSENT + " "); //$NON-NLS-1$ //$NON-NLS-2$ } else { result.append(name); } if (ad.getAnonymousTypeDefinition() == null && ad.getTypeDefinition() != null) { result.append(" : "); //$NON-NLS-1$ // result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration)); result.append(ad.getTypeDefinition().getName()); } return result.toString(); }
public IType getType() { XSDTypeDefinition td = getResolvedXSDAttributeDeclaration().getTypeDefinition(); return (td != null) ? (IType) XSDAdapterFactory.getInstance().adapt(td) : null; }
public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration attributeDeclaration) { XSDConcreteComponent target = null; if (attributeDeclaration.isAttributeDeclarationReference()) { target = attributeDeclaration.getResolvedAttributeDeclaration(); } else if (attributeDeclaration.getAnonymousTypeDefinition() == null) { target = attributeDeclaration.getTypeDefinition(); // Avoid navigating to built in data types. if (isFromSchemaForSchema(target)) { target = null; } } return target; }
@Override protected boolean analyze() { super.analyze(); Object newValue = null; XSDSimpleTypeDefinition xsdSimpleTypeDefinition = getAttributeDeclaration().getTypeDefinition(); if (xsdSimpleTypeDefinition != null) { String theLexicalValue = getLexicalValue(); if (theLexicalValue != null) { try { newValue = xsdSimpleTypeDefinition.getValue(theLexicalValue); } catch (RuntimeException exception) { // Ignore. } } } if (newValue == null ? getValue() != null : !newValue.equals(getValue())) { setValue(newValue); } return true; }
@Override protected boolean analyze() { super.analyze(); Object newValue = null; XSDSimpleTypeDefinition xsdSimpleTypeDefinition = getAttributeDeclaration().getTypeDefinition(); if (xsdSimpleTypeDefinition != null) { String theLexicalValue = getLexicalValue(); if (theLexicalValue != null) { try { newValue = xsdSimpleTypeDefinition.getValue(getElement(), theLexicalValue); } catch (RuntimeException exception) { // Ignore. } } } if (newValue == null ? getValue() != null : !newValue.equals(getValue())) { setValue(newValue); } return true; }
@Override protected void validateValue() { XSDSimpleTypeDefinition whiteSpaceEnumeration = ((XSDAttributeUse) ((XSDComplexTypeDefinition) getSimpleTypeDefinition(). getSchema(). getSchemaForSchema(). resolveElementDeclaration("whiteSpace"). getTypeDefinition()). getAttributeContents().get(0)). getAttributeDeclaration().getTypeDefinition(); checkSimpleTypeConstraint (whiteSpaceEnumeration, getLexicalValue(), XSDConstants.PART2, "element-whiteSpace", getElement(), XSDConstants.VALUE_ATTRIBUTE, true); }
@Override protected void validateValue() { XSDSimpleTypeDefinition whiteSpaceEnumeration = ((XSDAttributeUse) ((XSDComplexTypeDefinition) getSimpleTypeDefinition(). getSchema(). getSchemaForSchema(). resolveElementDeclaration("whiteSpace"). getTypeDefinition()). getAttributeContents().get(0)). getAttributeDeclaration().getTypeDefinition(); checkSimpleTypeConstraint (whiteSpaceEnumeration, getLexicalValue(), XSDConstants.PART2, "element-whiteSpace", getElement(), XSDConstants.VALUE_ATTRIBUTE, true); }
public static class FeatureIteratorImpl extends EContentsEList.FeatureIteratorImpl<XSDConcreteComponent> { public FeatureIteratorImpl(EObject eObject) { super(eObject, (EStructuralFeature [])((BasicEList<?>)eObject.eClass().getEAllReferences()).data()); } public FeatureIteratorImpl(EObject eObject, EStructuralFeature [] eStructuralFeatures) { super(eObject, eStructuralFeatures); } @Override protected boolean isIncluded(EStructuralFeature eStructuralFeature) { EReference eReference = (EReference)eStructuralFeature; return !eReference.isTransient(); } } }
public static class FeatureIteratorImpl extends EContentsEList.FeatureIteratorImpl<XSDConcreteComponent> { public FeatureIteratorImpl(EObject eObject) { super(eObject, (EStructuralFeature [])((BasicEList<?>)eObject.eClass().getEAllReferences()).data()); } public FeatureIteratorImpl(EObject eObject, EStructuralFeature [] eStructuralFeatures) { super(eObject, eStructuralFeatures); } @Override protected boolean isIncluded(EStructuralFeature eStructuralFeature) { EReference eReference = (EReference)eStructuralFeature; return !eReference.isTransient(); } } }
protected XSDAttributeDeclaration buildGlobalAttribute(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature) { XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration(); xsdAttributeDeclaration.setName(extendedMetaData.getName(eStructuralFeature)); XSDSimpleTypeDefinition xsdSimpleTypeDefinition = xsdSchema.resolveSimpleTypeDefinitionURI(getURI(eStructuralFeature.getEType())); handleImport(xsdSchema, xsdSimpleTypeDefinition); xsdAttributeDeclaration.setTypeDefinition(xsdSimpleTypeDefinition); String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) { xsdAttributeDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL); xsdAttributeDeclaration.setLexicalValue(transformDefaultValue(xsdAttributeDeclaration.getTypeDefinition(), defaultValue)); } xsdSchema.getContents().add(xsdAttributeDeclaration); map(xsdAttributeDeclaration, eStructuralFeature); if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)) { createEcoreAnnotation(xsdAttributeDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType())); } buildAnnotations(xsdAttributeDeclaration, eStructuralFeature); return xsdAttributeDeclaration; }