public Expression getJavaClassLitteralExpression(TypeRef tr) { JavaPrim prim = result.typeConverter.getPrimitive(tr); return prim != null ? classLiteral(prim.type) : typeLiteral(tr.clone()); }
public Expression getJavaClassLitteralExpression(TypeRef tr) { JavaPrim prim = result.typeConverter.getPrimitive(tr); return prim != null ? classLiteral(prim.type) : typeLiteral(tr.clone()); }
@Override protected void fillLibraryMapping(Result result, SourceFiles sourceFiles, DeclarationsHolder declarations, DeclarationsHolder implementations, String library, Identifier javaPackage, Expression nativeLibFieldExpr) throws IOException { super.fillLibraryMapping(result, sourceFiles, declarations, implementations, library, javaPackage, nativeLibFieldExpr); if (implementations instanceof ModifiableElement) { ModifiableElement minterf = (ModifiableElement) implementations; List<String> deps = result.config.dependencies.get(library); Map<String, Expression> namedArguments = null; if (deps != null) { List<Expression> depExprs = new ArrayList<Expression>(); for (String dep : deps) depExprs.add(expr(dep)); namedArguments = ImmutableMap.<String, Expression>of( "dependencies", NewArray.newAnnotationArrayValue(depExprs)); } minterf.addAnnotation(new Annotation(typeRef(org.bridj.ann.Library.class), expr(library), namedArguments)); minterf.addAnnotation(new Annotation(typeRef(org.bridj.ann.Runtime.class), classLiteral(result.hasCPlusPlus ? CPPRuntime.class : CRuntime.class))); } }
@Override protected void fillLibraryMapping(Result result, SourceFiles sourceFiles, DeclarationsHolder declarations, DeclarationsHolder implementations, String library, Identifier javaPackage, Expression nativeLibFieldExpr) throws IOException { super.fillLibraryMapping(result, sourceFiles, declarations, implementations, library, javaPackage, nativeLibFieldExpr); if (implementations instanceof ModifiableElement) { ModifiableElement minterf = (ModifiableElement) implementations; List<String> deps = result.config.dependencies.get(library); Map<String, Expression> namedArguments = null; if (deps != null) { List<Expression> depExprs = new ArrayList<Expression>(); for (String dep : deps) depExprs.add(expr(dep)); namedArguments = ImmutableMap.<String, Expression>of( "dependencies", NewArray.newAnnotationArrayValue(depExprs)); } minterf.addAnnotation(new Annotation(typeRef(org.bridj.ann.Library.class), expr(library), namedArguments)); minterf.addAnnotation(new Annotation(typeRef(org.bridj.ann.Runtime.class), classLiteral(result.hasCPlusPlus ? CPPRuntime.class : CRuntime.class))); } }
if (brt != null) { globalType = typeRef(ident(GlobalPointerType.class, expr(typeRef(ident(brt))))); extraArg = classLiteral(brt); } else if (prim == TypeConversion.JavaPrim.Void) { globalType = typeRef(GlobalPointer.class);
if (brt != null) { globalType = typeRef(ident(GlobalPointerType.class, expr(typeRef(ident(brt))))); extraArg = classLiteral(brt); } else if (prim == TypeConversion.JavaPrim.Void) { globalType = typeRef(GlobalPointer.class);