Examples of FunctionMapper


Examples of com.sun.jna.FunctionMapper

    protected void tearDown() {
        testlib = null;
    }

    public void testFunctionMapper() throws Exception {
        FunctionMapper mapper = StdCallLibrary.FUNCTION_MAPPER;
        NativeLibrary lib = NativeLibrary.getInstance("testlib");

        Method[] methods = {
            TestLibrary.class.getMethod("returnInt32ArgumentStdCall",
                                        new Class[] { int.class }),
            TestLibrary.class.getMethod("returnStructureByValueArgumentStdCall",
                                        new Class[] {
                                            TestLibrary.TestStructure.ByValue.class
                                        }),
            TestLibrary.class.getMethod("callInt32StdCallCallback",
                                        new Class[] {
                                            TestLibrary.Int32Callback.class,
                                            int.class, int.class,
                                        }),
        };

        for (int i=0;i < methods.length;i++) {
            String name = mapper.getFunctionName(lib, methods[i]);
            assertTrue("Function name not decorated for method "
                       + methods[i].getName()
                       + ": " + name, name.indexOf("@") != -1);
            assertEquals("Wrong name in mapped function",
                         name, lib.getFunction(name, StdCallLibrary.STDCALL_CONVENTION).getName());
View Full Code Here

Examples of javax.el.FunctionMapper

import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

public class BenchmarkEl {
    public static void main(final String[] args) {
        final FunctionMapper functionMapper = new LibraryFunctionMapperBuilder().add("proctor", ProctorRuleFunctions.class).build();

        final ExpressionFactory expressionFactory = new ExpressionFactoryImpl();

        final CompositeELResolver elResolver = new CompositeELResolver();
        elResolver.add(new ArrayELResolver());
View Full Code Here

Examples of javax.el.FunctionMapper

    }

    static RandomTestChooser initializeRandomTestChooser(final List<Range> ranges, final List<TestBucket> buckets) {
        final ExpressionFactory expressionFactory = new ExpressionFactoryImpl();

        final FunctionMapper functionMapper = RuleEvaluator.FUNCTION_MAPPER;

        final ConsumableTestDefinition testDefinition = new ConsumableTestDefinition();
        testDefinition.setConstants(Collections.<String, Object>emptyMap());

        testDefinition.setBuckets(buckets);
View Full Code Here

Examples of javax.el.FunctionMapper

     */
    public ExpressionBuilder(String expression, ELContext ctx)
            throws ELException {
        this.expression = expression;

        FunctionMapper ctxFn = ctx.getFunctionMapper();
        VariableMapper ctxVar = ctx.getVariableMapper();

        if (ctxFn != null) {
            this.fnMapper = new FunctionMapperFactory(ctxFn);
        }
View Full Code Here

Examples of javax.el.FunctionMapper

        this.next = next;
    }

    public void apply(FaceletContext ctx, UIComponent parent)
            throws IOException, FacesException, FaceletException, ELException {
        FunctionMapper orig = ctx.getFunctionMapper();
        ctx.setFunctionMapper(new CompositeFunctionMapper(this, orig));
        try {
            next.apply(ctx, parent);
        } finally {
            ctx.setFunctionMapper(orig);
View Full Code Here

Examples of javax.el.FunctionMapper

    }
   
    public Class getType(EvaluationContext ctx)
    throws ELException {
       
        FunctionMapper fnMapper = ctx.getFunctionMapper();
       
        // quickly validate again for this request
        if (fnMapper == null) {
            throw new ELException(MessageFactory.get("error.fnMapper.null"));
        }
        Method m = fnMapper.resolveFunction(this.prefix, this.localName);
        if (m == null) {
            throw new ELException(MessageFactory.get("error.fnMapper.method",
                    this.getOutputName()));
        }
        return m.getReturnType();
View Full Code Here

Examples of javax.el.FunctionMapper

    }
   
    public Object getValue(EvaluationContext ctx)
    throws ELException {
       
        FunctionMapper fnMapper = ctx.getFunctionMapper();
       
        // quickly validate again for this request
        if (fnMapper == null) {
            throw new ELException(MessageFactory.get("error.fnMapper.null"));
        }
        Method m = fnMapper.resolveFunction(this.prefix, this.localName);
        if (m == null) {
            throw new ELException(MessageFactory.get("error.fnMapper.method",
                    this.getOutputName()));
        }
       
View Full Code Here

Examples of javax.el.FunctionMapper

   */
  public ExpressionBuilder(String expression, ELContext ctx)
      throws ELException {
    this.expression = expression;

    FunctionMapper ctxFn = ctx.getFunctionMapper();
    VariableMapper ctxVar = ctx.getVariableMapper();

    if (ctxFn != null) {
      this.fnMapper = new FunctionMapperFactory(ctxFn);
    }
View Full Code Here

Examples of javax.el.FunctionMapper

    }

    public Class getType(EvaluationContext ctx)
            throws ELException {
       
        FunctionMapper fnMapper = ctx.getFunctionMapper();
       
        // quickly validate again for this request
        if (fnMapper == null) {
            throw new ELException(MessageFactory.get("error.fnMapper.null"));
        }
        Method m = fnMapper.resolveFunction(this.prefix, this.localName);
        if (m == null) {
            throw new ELException(MessageFactory.get("error.fnMapper.method",
                    this.getOutputName()));
        }
        return m.getReturnType();
View Full Code Here

Examples of javax.el.FunctionMapper

    }

    public Object getValue(EvaluationContext ctx)
            throws ELException {
       
        FunctionMapper fnMapper = ctx.getFunctionMapper();
       
        // quickly validate again for this request
        if (fnMapper == null) {
            throw new ELException(MessageFactory.get("error.fnMapper.null"));
        }
        Method m = fnMapper.resolveFunction(this.prefix, this.localName);
        if (m == null) {
            throw new ELException(MessageFactory.get("error.fnMapper.method",
                    this.getOutputName()));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.