use of com.sun.xml.xsom.impl.RestrictionSimpleTypeImpl in project atlasmap by atlasmap.
the class complexType method action13.
private void action13() throws SAXException {
if (baseContentType == null) {
// contentType of the base type, which must be a complex type
baseContentType = new BaseContentSimpleTypeRef(baseType);
}
contentSimpleType = new RestrictionSimpleTypeImpl($runtime.document, null, /*?*/
locator2, null, null, true, Collections.EMPTY_SET, baseContentType);
contentType = contentSimpleType;
}
use of com.sun.xml.xsom.impl.RestrictionSimpleTypeImpl in project BIMserver by opensourceBIM.
the class XSDSchemaReader method createSimpleType.
private void createSimpleType(XSSimpleType simpleType) {
if (simpleType instanceof RestrictionSimpleTypeImpl) {
RestrictionSimpleTypeImpl restrictionSimpleTypeImpl = (RestrictionSimpleTypeImpl) simpleType;
String typeName = restrictionSimpleTypeImpl.getBaseType().getName();
if (typeName.equals("string")) {
EEnum eEnum = ecoreFactory.createEEnum();
eEnum.setName(simpleType.getName());
ePackage.getEClassifiers().add(eEnum);
int i = 0;
for (XSFacet facet : restrictionSimpleTypeImpl.getDeclaredFacets()) {
EEnumLiteral eEnumLiteral = ecoreFactory.createEEnumLiteral();
eEnumLiteral.setValue(i++);
eEnum.getELiterals().add(eEnumLiteral);
eEnumLiteral.setName(facet.getValue().toString().toUpperCase());
}
} else if (typeName.equals("double")) {
EClass eClass = ecoreFactory.createEClass();
eClass.setName(simpleType.getName());
ePackage.getEClassifiers().add(eClass);
} else if (typeName.equals("normalizedString")) {
EClass eClass = ecoreFactory.createEClass();
eClass.setName(simpleType.getName());
ePackage.getEClassifiers().add(eClass);
} else if (typeName.equals("boolean")) {
EClass eClass = ecoreFactory.createEClass();
eClass.setName(simpleType.getName());
ePackage.getEClassifiers().add(eClass);
} else if (typeName.equals("long")) {
EClass eClass = ecoreFactory.createEClass();
eClass.setName(simpleType.getName());
ePackage.getEClassifiers().add(eClass);
} else {
EClass eClass = ecoreFactory.createEClass();
eClass.setName(simpleType.getName());
ePackage.getEClassifiers().add(eClass);
}
} else {
System.out.println(simpleType.getName());
}
}
Aggregations