private boolean hasBase(SchemaType sType) { boolean hasBase; SchemaType baseEnumType = sType.getBaseEnumType(); if (baseEnumType.isAnonymousType() && baseEnumType.isSkippedAnonymousType()) { if (sType.getContentBasedOnType() != null) hasBase = sType.getContentBasedOnType().getBaseType() != baseEnumType; else hasBase = sType.getBaseType() != baseEnumType; } else hasBase = baseEnumType != sType; return hasBase; }
if (sType.getSimpleVariety() == SchemaType.UNION) sType = sType.getUnionCommonBaseType(); assert sType.getBaseEnumType() != null; if (hasBase(sType)) return findJavaType(sType.getBaseEnumType()).replace('$', '.') + ".Enum"; else return findJavaType(sType).replace('$', '.') + ".Enum";
if (isStringType(sType.getBaseEnumType()))
void printStringEnumeration(SchemaType sType) throws IOException SchemaType baseEnumType = sType.getBaseEnumType(); String baseEnumClass = baseEnumType.getFullJavaName(); boolean hasBase = hasBase(sType);
beType = sImpl.getBaseType().getBaseEnumType(); if( beType == null || sImpl.getBaseType() == beType ){ beType = sImpl; else if (sImpl.getBaseType().getBaseEnumType() != null) beType = sImpl.getBaseType().getBaseEnumType(); sImpl.setBaseEnumTypeRef(beType.getRef());
if (sType.getSimpleVariety() == SchemaType.UNION) sType = sType.getUnionCommonBaseType(); assert sType.getBaseEnumType() != null; return findJavaType(sType.getBaseEnumType()).replace('$', '.') + ".Enum";
public static String getNaturalJavaClassName(SchemaType st) { SchemaType schemaType = st; String result = null; if (st.getBaseEnumType() != null && !hasBase(st)) { return st.getFullJavaName().replace('$', '.') + ".Enum"; } else if (st.isSimpleType() && !st.isBuiltinType()) { schemaType = st.getBaseType(); while (schemaType != null && !schemaType.isBuiltinType()) { schemaType = schemaType.getBaseType(); } } if (schemaType != null && schemaType.isBuiltinType()) { result = BUILTIN_TYPES_MAP.get(schemaType.getFullJavaName()); } else if (schemaType != null) { result = schemaType.getFullJavaName().replace('$', '.'); } return result; } private static boolean hasBase(SchemaType sType) {
private static boolean hasBase(SchemaType sType) { boolean hasBase; SchemaType baseEnumType = sType.getBaseEnumType(); if (baseEnumType.isAnonymousType() && baseEnumType.isSkippedAnonymousType()) { if (sType.getContentBasedOnType() != null) { hasBase = sType.getContentBasedOnType().getBaseType() != baseEnumType; } else { hasBase = sType.getBaseType() != baseEnumType; } } else { hasBase = baseEnumType != sType; } return hasBase; } }
private boolean hasBase(SchemaType sType) { boolean hasBase; SchemaType baseEnumType = sType.getBaseEnumType(); if (baseEnumType.isAnonymousType() && baseEnumType.isSkippedAnonymousType()) { if (sType.getContentBasedOnType() != null) hasBase = sType.getContentBasedOnType().getBaseType() != baseEnumType; else hasBase = sType.getBaseType() != baseEnumType; } else hasBase = baseEnumType != sType; return hasBase; }
public Set getDependencies() { SchemaProperty[] properties = schemaType.getProperties(); HashSet deps = new HashSet(); for (int i = 0; i < properties.length; i++) { SchemaType etype = properties[i].getType(); SchemaProperty[] iprops = etype.getElementProperties(); for (int j = 0; j < iprops.length; j++) { SchemaType itype = iprops[j].getType(); testAndAddType(deps, itype); } testAndAddType(deps, etype.getBaseType()); testAndAddType(deps, etype.getBaseEnumType()); } return deps; }
if (sType.getSimpleVariety() == SchemaType.UNION) sType = sType.getUnionCommonBaseType(); assert sType.getBaseEnumType() != null; if (hasBase(sType)) return findJavaType(sType.getBaseEnumType()).replace('$', '.') + ".Enum"; else return findJavaType(sType).replace('$', '.') + ".Enum";
writeType(type.getBaseEnumType()); if (type.hasStringEnumValues())
if (isStringType(sType.getBaseEnumType()))
if (isStringType(sType.getBaseEnumType()))
void printStringEnumeration(SchemaType sType) throws IOException SchemaType baseEnumType = sType.getBaseEnumType(); String baseEnumClass = baseEnumType.getFullJavaName(); boolean hasBase = hasBase(sType);
beType = sImpl.getBaseType().getBaseEnumType(); if( beType == null || sImpl.getBaseType() == beType ){ beType = sImpl; else if (sImpl.getBaseType().getBaseEnumType() != null) beType = sImpl.getBaseType().getBaseEnumType(); sImpl.setBaseEnumTypeRef(beType.getRef());
void printStringEnumeration(SchemaType sType) throws IOException SchemaType baseEnumType = sType.getBaseEnumType(); String baseEnumClass = baseEnumType.getFullJavaName(); boolean hasBase;
beType = sImpl.getBaseType().getBaseEnumType(); if( beType == null || sImpl.getBaseType() == beType ){ beType = sImpl; else if (sImpl.getBaseType().getBaseEnumType() != null) beType = sImpl.getBaseType().getBaseEnumType(); sImpl.setBaseEnumTypeRef(beType.getRef());
writeType(type.getBaseEnumType()); if (type.hasStringEnumValues())
writeType(type.getBaseEnumType()); if (type.hasStringEnumValues())