public AdaptingWrappingField(ClassOutlineImpl context, CPropertyInfo prop, CPropertyInfo core, CAdapter adapter) { super(context, prop, core); this.xmlAdapterClass = adapter == null ? null : adapter .getAdapterClass(context.parent()); }
/** * return the Java type for the given type reference in the model. */ private JType resolve(CTypeRef typeRef,Aspect a) { return outline.parent().resolve(typeRef,a); }
/** * return the Java type for the given type reference in the model. */ private JType resolve(CTypeRef typeRef,Aspect a) { return outline.parent().resolve(typeRef,a); }
/** * return the Java type for the given type reference in the model. */ private JType resolve(CTypeRef typeRef,Aspect a) { return outline.parent().resolve(typeRef,a); } }
/** * return the Java type for the given type reference in the model. */ private JType resolve(CTypeRef typeRef,Aspect a) { return outline.parent().resolve(typeRef,a); }
/** * return the Java type for the given type reference in the model. */ private JType resolve(CTypeRef typeRef,Aspect a) { return outline.parent().resolve(typeRef,a); }
public JClass getScope(CClassInfo scope) { if (scope == null) { return codeModel.ref(GlobalScope.class); } else { return scope.toType(outline.parent(), Aspect.EXPOSED); } }
public SingleEnumValueWrappingField(ClassOutlineImpl context, CPropertyInfo prop, CPropertyInfo core) { super(context, prop, core); // Single assert !core.isCollection(); // Builtin assert core.ref().size() == 1; assert core.ref().iterator().next() instanceof CEnumLeafInfo; this.enumType = (CEnumLeafInfo) core.ref().iterator().next(); this.enumClass = this.enumType.toType(context.parent(), Aspect.EXPOSED); }
public FieldOutline generate(ClassOutlineImpl outline, CPropertyInfo prop) { if(prop.defaultValue.compute(outline.parent())==null) return fallback.generate(outline, prop); else return new ConstField(outline,prop); } }
protected AbstractField( ClassOutlineImpl outline, CPropertyInfo prop ) { this.outline = outline; this.prop = prop; this.codeModel = outline.parent().getCodeModel(); this.implType = getType(IMPLEMENTATION); this.exposedType = getType(Aspect.EXPOSED); }
public FieldOutline generate(ClassOutlineImpl outline, CPropertyInfo prop) { if(prop.defaultValue.compute(outline.parent())==null) return fallback.generate(outline, prop); else return new ConstField(outline,prop); } }
protected AbstractField( ClassOutlineImpl outline, CPropertyInfo prop ) { this.outline = outline; this.prop = prop; this.codeModel = outline.parent().getCodeModel(); this.implType = getType(IMPLEMENTATION); this.exposedType = getType(Aspect.EXPOSED); }
protected AbstractField( ClassOutlineImpl outline, CPropertyInfo prop ) { this.outline = outline; this.prop = prop; this.codeModel = outline.parent().getCodeModel(); this.implType = getType(IMPLEMENTATION); this.exposedType = getType(Aspect.EXPOSED); }
public FieldOutline generate(ClassOutlineImpl outline, CPropertyInfo prop) { if(prop.defaultValue.compute(outline.parent())==null) return fallback.generate(outline, prop); else return new ConstField(outline,prop); } }
@Override public JExpression unwrapCondifiton(JExpression source) { final JType type = getTypeRef().getTarget().toType(outline.parent(), Aspect.EXPOSED); return JOp._instanceof(source, type); }
@Override public JExpression unwrapCondifiton(JExpression source) { final JType type = getTypeRef().getTarget().toType(outline.parent(), Aspect.EXPOSED); return JOp._instanceof(source, type); }
@Override protected JExpression unwrap(JExpression source) { return codeModel.ref(JAXBElementUtils.class).staticInvoke("getName") .arg( JExpr.cast(codeModel.ref(JAXBElement.class).narrow( elementType.toType(outline.parent(), Aspect.EXPOSED).boxify()), source)); }
@Override protected JExpression unwrap(JExpression source) { return codeModel.ref(JAXBElementUtils.class).staticInvoke("getValue") .arg( JExpr.cast(codeModel.ref(JAXBElement.class).narrow( type.toType(outline.parent(), Aspect.EXPOSED) .boxify()), source)); }
@Override protected JExpression unwrap(JExpression source) { return codeModel.ref(JAXBElementUtils.class).staticInvoke("getName") .arg( JExpr.cast(codeModel.ref(JAXBElement.class).narrow( elementType.toType(outline.parent(), Aspect.EXPOSED).boxify()), source)); }
@Override protected JExpression wrap(JExpression source) { final JExpression core = getCore(); return codeModel.ref(JAXBElementUtils.class).staticInvoke("wrap").arg( core).arg(source).arg( elementType.toType(outline.parent(), Aspect.EXPOSED).boxify() .dotclass()); }