Examples of Parameter


Examples of japa.parser.ast.body.Parameter

  @Test
  public void testParseParams() {
    String src = "@ Default (3 ) int i,  @Default(foo()+ \"aa\")String s, String m, @Default(\"aa\")String ss";
    List<Parameter> pama = JavaSyntaxTool.parseParams(src);
    Parameter p = pama.get(0);
    String def = JavaSyntaxTool.getDefault(p);
    assertEquals("3", def);
    // System.out.println(def);

    p = pama.get(1);
View Full Code Here

Examples of java.lang.reflect.Parameter

    private static void method(String param1, Integer param2) {
    }

    @Test
    public void testGetJavaParameter() {
        Parameter param1 = new MockAnnotatedParameter(0).getJavaParameter();
        Parameter param2 = new MockAnnotatedParameter(1).getJavaParameter();

        Assert.assertEquals(String.class, param1.getParameterizedType());
        Assert.assertEquals(Integer.class, param2.getParameterizedType());
    }
View Full Code Here

Examples of javax.faces.component.behavior.ClientBehaviorContext.Parameter

    public static List<Parameter> createParametersList(Map<String, Object> parametersMap) {
        List<Parameter> parameters = new ArrayList<Parameter>(parametersMap.size());

        for (Entry<String, Object> entry : parametersMap.entrySet()) {
            parameters.add(new Parameter(entry.getKey(), entry.getValue()));
        }

        return parameters;
    }
View Full Code Here

Examples of javax.faces.flow.Parameter

            if (null != params) {
                List<Class> paramTypes = Collections.emptyList();
                if (0 < params.getLength()) {
                    paramTypes = new ArrayList<Class>();
                    List<Parameter> paramList = new ArrayList<Parameter>();
                    Parameter toAdd = null;
                    ExpressionFactory ef = context.getApplication().getExpressionFactory();
                    ELContext elContext = context.getELContext();
                    ValueExpression ve = null;
                   
                    for (int i_param = 0; i_param < params.getLength(); i_param++) {
View Full Code Here

Examples of javax.persistence.Parameter

  @Override
  @SuppressWarnings("unchecked")
  public <T> Parameter<T> getParameter(String name, Class<T> type) {
    checkOpen( false );
    Parameter param = getParameter( name );

    if ( param.getParameterType() != null ) {
      // we were able to determine the expected type during analysis, so validate it here
      if ( ! param.getParameterType().isAssignableFrom( type ) ) {
        throw new IllegalArgumentException(
            String.format(
                "Parameter type [%s] is not assignment compatible with requested type [%s] for parameter named [%s]",
                param.getParameterType().getName(),
                type.getName(),
                name
            )
        );
      }
View Full Code Here

Examples of javax.websocket.Extension.Parameter

        Extension ext = result.get(0);
        Assert.assertEquals("ext", ext.getName());
        List<Parameter> params = ext.getParameters();
        Assert.assertEquals(2, params.size());
        Parameter paramA = params.get(0);
        Assert.assertEquals("a", paramA.getName());
        Assert.assertEquals("1", paramA.getValue());
        Parameter paramB = params.get(1);
        Assert.assertEquals("b", paramB.getName());
        Assert.assertEquals("2", paramB.getValue());

        Extension ext2 = result.get(1);
        Assert.assertEquals("ext2", ext2.getName());
        List<Parameter> params2 = ext2.getParameters();
        Assert.assertEquals(2, params2.size());
        Parameter paramC = params2.get(0);
        Assert.assertEquals("c", paramC.getName());
        Assert.assertNull(paramC.getValue());
        Parameter paramD = params2.get(1);
        Assert.assertEquals("d", paramD.getName());
        Assert.assertEquals("xyz", paramD.getValue());

        Extension ext3 = result.get(2);
        Assert.assertEquals("ext3", ext3.getName());
        List<Parameter> params3 = ext3.getParameters();
        Assert.assertEquals(0, params3.size());
View Full Code Here

Examples of jease.cms.domain.Parameter

import jfix.zk.View;

public class TableModel extends ObjectTableModel<Parameter> {

  public Parameter newObject() {
    return new Parameter();
  }
View Full Code Here

Examples of jmt.engine.jwat.input.Parameter

      }
      def[i] = ((String) defaults.get(i));
      rep[i] = ((String) replaces.get(i));
    }
    FilterOnVariable filter = null;
    return new Parameter(boolVariables, typeVariables, regExpVariable, delim, nameVariables, 0, filter, null, def, rep);
  }
View Full Code Here

Examples of lipstone.joshua.parser.plugin.helpdata.Parameter

    loadHyperbolicTrigFunctions();
    loadInverseHyperbolicTrigFunctions();
  }
 
  private void loadTrigFunctions() throws PluginConflictException {
    Parameter x = new Parameter("x", "Any real number", false);
    ArrayList<Parameter> params = new ArrayList<Parameter>();
    params.add(x);
    addOperation(new Operation("sin", params, "the sine of x.", "Use the angle type options to specify Degrees/Radians/Grads", this));
    addOperation(new Operation("cos", params, "the cosine of x.", "Use the angle type options to specify Degrees/Radians/Grads", this));
    addOperation(new Operation("tan", params, "the tangent of x.", "Use the angle type options to specify Degrees/Radians/Grads", this));
   
    x = new Parameter("x", "Any real number except odd multiples of pi/2", false);
    params.set(0, x);
    addOperation(new Operation("sec", params, "the secant of x.", "Use the angle type options to specify Degrees/Radians/Grads", this));
    x = new Parameter("x", "Any real number except multiples of pi", false);
    params.set(0, x);
    addOperation(new Operation("csc", params, "the cosecant of x.", "Use the angle type options to specify Degrees/Radians/Grads", this));
    addOperation(new Operation("cot", params, "the cotangent of x.", "Use the angle type options to specify Degrees/Radians/Grads", this));
  }
View Full Code Here

Examples of mondrian.olap.Parameter

      }

      final Parameter[] parameterDefs = query.getParameters();
      for (int i = 0; i < parameterDefs.length; i++)
      {
        final Parameter def = parameterDefs[i];
        Object parameterValue = parameters.get(def.getName());
        final Object processedParamValue;
        final Type parameterType = def.getType();

        // Mondrian doesn't handle null MemberType/SetType parameters well (http://jira.pentaho.com/browse/MONDRIAN-745)
        // If parameterValue is null, give it the default value
        try
        {
          if (parameterValue == null && (parameterType instanceof MemberType || parameterType instanceof SetType))
          {
            parameterValue = def.getDefaultExp().toString();
          }
        }
        catch (Exception e)
        {
          // Ignore - this is a safety procedure anyway
        }

        if (parameterValue != null)
        {

          if (parameterType instanceof StringType)
          {
            if (!(parameterValue instanceof String))
            {
              throw new ReportDataFactoryException(parameterValue + " is incorrect for type " + parameterType);
            }
            processedParamValue = parameterValue;
          }
          else if (parameterType instanceof NumericType)
          {
            if (!(parameterValue instanceof Number))
            {
              throw new ReportDataFactoryException(parameterValue + " is incorrect for type " + parameterType);
            }
            processedParamValue = parameterValue;
          }
          else if (parameterType instanceof MemberType)
          {
            final MemberType memberType = (MemberType) parameterType;
            final Hierarchy hierarchy = memberType.getHierarchy();
            if (parameterValue instanceof String)
            {
              final Member member = findMember(query, hierarchy, query.getCube(), String.valueOf(parameterValue));
              if (member != null)
              {
                processedParamValue = new MemberExpr(member);
              }
              else
              {
                processedParamValue = null;
              }
            }
            else
            {
              if (!(parameterValue instanceof OlapElement))
              {
                throw new ReportDataFactoryException(parameterValue + " is incorrect for type " + parameterType);
              }
              else
              {
                processedParamValue = parameterValue;
              }
            }
          }
          else if (parameterType instanceof SetType)
          {
            final SetType setType = (SetType) parameterType;
            final Hierarchy hierarchy = setType.getHierarchy();
            if (parameterValue instanceof String)
            {
              final String rawString = (String) parameterValue;
              final String[] memberStr = rawString.replaceFirst("^ *\\{", "").replaceFirst("} *$", "").split(",");
              final List<Member> list = new ArrayList<Member>(memberStr.length);

              for (int j = 0; j < memberStr.length; j++)
              {
                final String str = memberStr[j];
                final Member member = findMember(query, hierarchy, query.getCube(), String.valueOf(str));
                if (member != null)
                {
                  list.add(member);
                }
              }

              processedParamValue = list;
            }
            else
            {
              if (!(parameterValue instanceof OlapElement))
              {
                throw new ReportDataFactoryException(parameterValue + " is incorrect for type " + parameterType);
              }
              else
              {
                processedParamValue = parameterValue;
              }
            }
          }
          else
          {
            processedParamValue = parameterValue;
          }
        }
        else
        {
          processedParamValue = null;
        }

        // Mondrian allows null values to be passed in, so we'll go ahead and
        // convert null values to their defaults for now until MONDRIAN-745 is
        // resolved.

        final Exp exp = def.getDefaultExp();
        if (processedParamValue == null && exp != null && exp instanceof Literal)
        {
          def.setValue(((Literal) exp).getValue());
        }
        else
        {
          def.setValue(processedParamValue);
        }
      }

      final Result resultSet = connection.execute(query);
      if (resultSet == null)
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.