public static Set<JType> getPossibleTypes(Outline outline, Aspect aspect, CTypeInfo typeInfo) { final Set<JType> types = new HashSet<JType>(); types.add(typeInfo.getType().toType(outline, aspect)); if (typeInfo instanceof CElementInfo) { final CElementInfo elementInfo = (CElementInfo) typeInfo; for (CElementInfo substitutionMember : elementInfo .getSubstitutionMembers()) { types.addAll(getPossibleTypes(outline, aspect, substitutionMember)); } } return types; }
return t.getType().isBoxedType();
return t.getType().isBoxedType();
return t.getType().isBoxedType();
return t.getType().isBoxedType();
return t.getType().isBoxedType();
/** * Returns contents to be added to javadoc. */ protected final List<Object> listPossibleTypes( CPropertyInfo prop ) { List<Object> r = new ArrayList<Object>(); for( CTypeInfo tt : prop.ref() ) { JType t = tt.getType().toType(outline.parent(),Aspect.EXPOSED); if( t.isPrimitive() || t.isArray() ) r.add(t.fullName()); else { r.add(t); r.add("\n"); } } return r; }
/** * Returns contents to be added to javadoc. */ protected final List<Object> listPossibleTypes( CPropertyInfo prop ) { List<Object> r = new ArrayList<Object>(); for( CTypeInfo tt : prop.ref() ) { JType t = tt.getType().toType(outline.parent(),Aspect.EXPOSED); if( t.isPrimitive() || t.isArray() ) r.add(t.fullName()); else { r.add(t); r.add("\n"); } } return r; }
/** * Returns contents to be added to javadoc. */ protected final List<Object> listPossibleTypes( CPropertyInfo prop ) { List<Object> r = new ArrayList<Object>(); for( CTypeInfo tt : prop.ref() ) { JType t = tt.getType().toType(outline.parent(),Aspect.EXPOSED); if( t.isPrimitive() || t.isArray() ) r.add(t.fullName()); else { r.add(t); r.add("\n"); } } return r; }
/** * Returns contents to be added to javadoc. */ protected final List<Object> listPossibleTypes( CPropertyInfo prop ) { List<Object> r = new ArrayList<Object>(); for( CTypeInfo tt : prop.ref() ) { JType t = tt.getType().toType(outline.parent(),Aspect.EXPOSED); if( t.isPrimitive() || t.isArray() ) r.add(t.fullName()); else { r.add(t); r.add("\n"); } } return r; }
/** * Returns contents to be added to javadoc. */ protected final List<Object> listPossibleTypes( CPropertyInfo prop ) { List<Object> r = new ArrayList<Object>(); for( CTypeInfo tt : prop.ref() ) { JType t = tt.getType().toType(outline.parent(),Aspect.EXPOSED); if( t.isPrimitive() || t.isArray() ) r.add(t.fullName()); else { r.add(t); r.add("\n"); } } return r; }
/** * Returns contents to be added to javadoc. */ protected final List<Object> listPossibleTypes( CPropertyInfo prop ) { List<Object> r = new ArrayList<Object>(); for( CTypeInfo tt : prop.ref() ) { JType t = tt.getType().toType(outline.parent(),Aspect.EXPOSED); if( t.isPrimitive() || t.isArray() ) r.add(t.fullName()); else { r.add(t); r.add("\n"); } } return r; }
/** * Returns contents to be added to javadoc. */ protected final List<Object> listPossibleTypes( CPropertyInfo prop ) { List<Object> r = new ArrayList<Object>(); for( CTypeInfo tt : prop.ref() ) { JType t = tt.getType().toType(outline.parent(),Aspect.EXPOSED); if( t.isPrimitive() || t.isArray() ) r.add(t.fullName()); else { r.add(t); r.add("\n"); } } return r; }
/** * Returns contents to be added to javadoc. * <p> * <b>Description and code copied from the class SingleField</b> * * @see <a href="https://jaxb2-commons.dev.java.net/source/browse/jaxb2-commons/property-listener-injector/src/com/sun/tools/xjc/addon/property_listener_injector/SingleField.java"> * https://jaxb2-commons.dev.java.net/source/browse/jaxb2-commons/property-listener-injector/src/com/sun/tools/xjc/addon/property_listener_injector/SingleField.java</a> */ protected final List<Object> listPossibleTypes( CPropertyInfo prop ) { List<Object> r = new ArrayList<Object>(); for( CTypeInfo tt : prop.ref() ) { JType t = tt.getType().toType(outline.parent(),Aspect.EXPOSED); if( t.isPrimitive() || t.isArray() ) r.add(t.fullName()); else { r.add(t); r.add("\n"); } } return r; }
private AvroType avroFromProperty(CPropertyInfo info, JPackage _package) { // collections if (info.isCollection()) { List<AvroType> elements = new ArrayList<AvroType>(); // for every type in the collection for (CTypeInfo typeInfo : info.ref()) { elements.add(avroFromProperty(info, typeInfo.getType(), _package, false)); } AvroType type; if (elements.size() == 1) { type = new AvroArray(elements.get(0)); } else { type = new AvroArray(new AvroUnion(elements)); } if (!isPropertyRequired(info)) { type = new AvroUnion(AvroPrimitive.NULL_TYPE, type); } return type; // single elements } else { assertThat(info.ref().size() == 1, "can't handle multiple refs here"); NType type = info.ref().iterator().next().getType(); return avroFromProperty(info, type, _package, true); } }
public Collection<FieldOutline> getTargetIdFieldsOutline(Mapping context, FieldOutline fieldOutline) { final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, propertyInfo); final CTypeInfo type = CTypeInfoUtils.getCommonBaseTypeInfo(types); assert type != null; assert type instanceof CClass; if (type instanceof CClassInfo) { final ClassOutline targetClassOutline = fieldOutline.parent() .parent().getClazz((CClassInfo) type); return getIdFieldsOutline(targetClassOutline); } else { logger.error(MessageFormat .format("Field outline [{0}] references the type [{1}] which is not present in the XJC model " + "(it is probably a class reference due to episodic compilation). " + "Due to this reason Hyperjaxb3 cannot generate correct identifier column mapping. " + "Please customize your association manually. See also issue HJIII-51.", propertyInfo.getName(true), type.getType() .fullName())); return Collections.emptyList(); } }
public Collection<FieldOutline> getTargetIdFieldsOutline(Mapping context, FieldOutline fieldOutline) { final CPropertyInfo propertyInfo = fieldOutline.getPropertyInfo(); final Collection<? extends CTypeInfo> types = context.getGetTypes() .process(context, propertyInfo); final CTypeInfo type = CTypeInfoUtils.getCommonBaseTypeInfo(types); assert type != null; assert type instanceof CClass; if (type instanceof CClassInfo) { final ClassOutline targetClassOutline = fieldOutline.parent() .parent().getClazz((CClassInfo) type); return getIdFieldsOutline(targetClassOutline); } else { logger.error(MessageFormat .format("Field outline [{0}] references the type [{1}] which is not present in the XJC model " + "(it is probably a class reference due to episodic compilation). " + "Due to this reason Hyperjaxb3 cannot generate correct identifier column mapping. " + "Please customize your association manually. See also issue HJIII-51.", propertyInfo.getName(true), type.getType() .fullName())); return Collections.emptyList(); } }