{
eReferenceToOppositeNameMap.put(eReference, opposite);
}
XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)xsdComponent;
XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration();
extendedMetaData.setFeatureKind(eReference, ExtendedMetaData.ATTRIBUTE_FEATURE);
extendedMetaData.setName(eReference, xsdAttributeDeclaration.getName());
extendedMetaData.setNamespace(eReference, xsdAttributeDeclaration.getTargetNamespace());
eReference.setResolveProxies
(!isLocalReferenceType((XSDSimpleTypeDefinition)getEffectiveTypeDefinition(xsdAttributeUse, xsdAttributeDeclaration)));
}
else if (xsdComponent instanceof XSDAttributeDeclaration)
{
XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)xsdComponent;
extendedMetaData.setFeatureKind(eReference, ExtendedMetaData.ATTRIBUTE_FEATURE);
extendedMetaData.setName(eReference, xsdAttributeDeclaration.getName());
extendedMetaData.setNamespace(eReference, xsdAttributeDeclaration.getTargetNamespace());
eReference.setResolveProxies
(!isLocalReferenceType((XSDSimpleTypeDefinition)getEffectiveTypeDefinition(null, xsdAttributeDeclaration)));
}
}
return eReference;
}
else
{
EAttribute eAttribute = ecoreFactory.createEAttribute();
setAnnotations(eAttribute, xsdComponent);
eAttribute.setName(Character.toLowerCase(name.charAt(0)) + name.substring(1));
eAttribute.setUnique(false);
eAttribute.setEType(type);
eAttribute.setLowerBound(minOccurs);
eAttribute.setUpperBound(maxOccurs);
eClass.getEStructuralFeatures().add(eAttribute);
if (xsdComponent == null || xsdComponent instanceof XSDSimpleTypeDefinition)
{
extendedMetaData.setName(eAttribute, ":" + eClass.getEAllStructuralFeatures().indexOf(eAttribute));
extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.SIMPLE_FEATURE);
}
else
{
map(xsdComponent, eAttribute);
if (xsdComponent instanceof XSDAttributeUse)
{
XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)xsdComponent;
XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration();
extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.ATTRIBUTE_FEATURE);
extendedMetaData.setName(eAttribute, xsdAttributeDeclaration.getName());
extendedMetaData.setNamespace(eAttribute, xsdAttributeDeclaration.getTargetNamespace());
String defaultValue = getEcoreAttribute(xsdComponent, "default");
if (defaultValue == null)
{
defaultValue = xsdAttributeUse.getLexicalValue();
}
eAttribute.setDefaultValueLiteral(defaultValue);
initialize(eAttribute, (XSDSimpleTypeDefinition)getEffectiveTypeDefinition(xsdAttributeUse, xsdAttributeDeclaration));
}
else if (xsdComponent instanceof XSDAttributeDeclaration)
{
XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)xsdComponent;
extendedMetaData.setFeatureKind(eAttribute, ExtendedMetaData.ATTRIBUTE_FEATURE);
extendedMetaData.setName(eAttribute, xsdAttributeDeclaration.getName());
extendedMetaData.setNamespace(eAttribute, xsdAttributeDeclaration.getTargetNamespace());
eAttribute.setDefaultValueLiteral(xsdAttributeDeclaration.getLexicalValue());
initialize(eAttribute, (XSDSimpleTypeDefinition)getEffectiveTypeDefinition(null, xsdAttributeDeclaration));
}
else if (xsdComponent instanceof XSDParticle)
{
XSDTerm xsdTerm = ((XSDParticle)xsdComponent).getTerm();