use of org.eclipse.persistence.internal.oxm.schema.model.SimpleType in project eclipselink by eclipse-ee4j.
the class SDOTypesGenerator method processGlobalSimpleTypes.
private void processGlobalSimpleTypes(Schema schema) {
Collection<SimpleType> simpleTypes = schema.getTopLevelSimpleTypes().values();
if (simpleTypes == null) {
return;
}
Iterator<SimpleType> simpleTypesIter = simpleTypes.iterator();
while (simpleTypesIter.hasNext()) {
SimpleType simpleType = simpleTypesIter.next();
String targetNamespace = schema.getTargetNamespace();
if (null == targetNamespace) {
targetNamespace = "";
}
processGlobalSimpleType(targetNamespace, schema.getDefaultNamespace(), simpleType);
}
}
use of org.eclipse.persistence.internal.oxm.schema.model.SimpleType in project eclipselink by eclipse-ee4j.
the class SDOTypesGenerator method processAttribute.
private SDOType processAttribute(String targetNamespace, String defaultNamespace, SDOType owningType, Attribute attribute, boolean isGlobal) {
SimpleType simpleType = attribute.getSimpleType();
if (simpleType != null) {
SDOType propertyType = processSimpleType(targetNamespace, defaultNamespace, attribute.getName(), simpleType);
processSimpleAttribute(targetNamespace, defaultNamespace, owningType, attribute, isGlobal, rootSchema.isAttributeFormDefault(), propertyType);
propertyType.setXsdLocalName(attribute.getName());
propertyType.setXsd(true);
return propertyType;
} else {
processSimpleAttribute(targetNamespace, defaultNamespace, owningType, attribute, isGlobal, rootSchema.isAttributeFormDefault() || isGlobal, null);
return null;
}
}
use of org.eclipse.persistence.internal.oxm.schema.model.SimpleType in project eclipselink by eclipse-ee4j.
the class SDOTypesGenerator method processBaseType.
private Type processBaseType(String targetNamespace, String defaultNamespace, SDOType owningType, String qualifiedName, boolean simpleContentExtension, Restriction restriction) {
if (qualifiedName == null) {
return null;
}
SDOType baseType = getSDOTypeForName(targetNamespace, defaultNamespace, qualifiedName);
QName baseQName = getQNameForString(defaultNamespace, qualifiedName);
if (!baseType.isFinalized() && baseQName.getNamespaceURI().equals(targetNamespace)) {
if (baseType.isDataType()) {
SimpleType baseSimpleType = rootSchema.getTopLevelSimpleTypes().get(baseQName.getLocalPart());
processGlobalSimpleType(targetNamespace, defaultNamespace, baseSimpleType);
} else {
ComplexType baseComplexType = rootSchema.getTopLevelComplexTypes().get(baseQName.getLocalPart());
processGlobalComplexType(targetNamespace, defaultNamespace, baseComplexType);
}
}
// Java instance class is int
if (baseQName.equals(XMLConstants.INTEGER_QNAME) || baseQName.equals(SDOConstants.POSITIVEINTEGER_QNAME) || baseQName.equals(SDOConstants.NEGATIVEINTEGER_QNAME) || baseQName.equals(SDOConstants.NONPOSITIVEINTEGER_QNAME) || baseQName.equals(SDOConstants.NONNEGATIVEINTEGER_QNAME) || baseQName.equals(XMLConstants.LONG_QNAME) || baseQName.equals(SDOConstants.UNSIGNEDLONG_QNAME)) {
boolean alreadySet = false;
String value = restriction.getMaxInclusive();
if (value != null) {
if (Integer.parseInt(value) <= Integer.MAX_VALUE) {
baseType = getTypeForXSDQName(XMLConstants.INT_QNAME);
alreadySet = true;
}
}
// if maxInclusive was processed, no need to handle maxExclusive
if (!alreadySet) {
value = restriction.getMaxExclusive();
if (value != null) {
if (Integer.parseInt(value) < Integer.MAX_VALUE) {
baseType = getTypeForXSDQName(XMLConstants.INT_QNAME);
}
}
}
}
processBaseType(baseType, targetNamespace, defaultNamespace, owningType, qualifiedName, simpleContentExtension);
return baseType;
}
Aggregations