Package com.codingcrayons.aspectfaces.annotation.registration.pointCut.properties

Examples of com.codingcrayons.aspectfaces.annotation.registration.pointCut.properties.Variable


    double sevenPointTwo = 7.2;
    TestObject testObject = new TestObject();
    boolean bool = true;

    List<Variable> vars = new ArrayList<Variable>(7);
    vars.add(new Variable("person", person));
    vars.add(new Variable("test", test));
    vars.add(new Variable("instance", instance));
    vars.add(new Variable("six", six));
    vars.add(new Variable("sevenPointTwo", sevenPointTwo));
    vars.add(new Variable("testObject", testObject));
    vars.add(new Variable("bool", bool));

    AFContext variableContext = ELUtil.makeVariableContext(vars);
    AFContext extendedVariableContext = ELUtil.makeExtendedVariableContext(vars);

    return new Object[][]{
View Full Code Here


  }

  @DataProvider
  public Object[][] unresolvedVariableProvider() {
    List<Variable> vars = new ArrayList<Variable>(2);
    vars.add(new Variable("t", true));
    vars.add(new Variable("f", false));

    AFContext variableContext = ELUtil.makeVariableContext(vars);

    return new Object[][]{
      new Object[]{variableContext, "#{person}", String.class, ""},
View Full Code Here

  @Test
  public void testIndependentContexts() {
    AFContext variableContext = ELUtil.makeVariableContext(new ArrayList<Variable>(1) {
      {
        add(new Variable("person", "test"));
      }
    });
    assertEL(variableContext, "#{person}", String.class, "test");

    variableContext = ELUtil.makeVariableContext(Collections.<Variable>emptyList());
View Full Code Here

  }

  @Test
  public void testGetTemplateVariables() {
    List<Variable> expected = new ArrayList<Variable>(3);
    expected.add(new Variable("var1", "var1", false, Variable.VarType.TEMPLATE));
    property.addVariable(expected.get(0));
    expected.add(new Variable("var2", "var2-unredefinable", false, Variable.VarType.TEMPLATE));
    property.addVariable(expected.get(1));
    expected.add(new Variable("var3", "var3-overridden", false, Variable.VarType.TEMPLATE));
    property.addVariable(new Variable("var3", "var3", true, Variable.VarType.TEMPLATE));
    property.addVariable(expected.get(2));
    property.addVariable(new Variable("var2", "var2", false, Variable.VarType.TEMPLATE));

    List<Variable> configVars = new ArrayList<Variable>(3);
    configVars.add(new Variable("var4", "var4", false, Variable.VarType.CONFIG));
    configVars.add(new Variable("var5", "var5", false, Variable.VarType.CONFIG));
    configVars.add(new Variable("var6", "var6", false, Variable.VarType.CONFIG));
    assertEquals(property.getTemplateVariables(), expected);
  }
View Full Code Here

  }

  @Test
  public void testGetConfigVariables() {
    List<Variable> expected = new ArrayList<Variable>(3);
    expected.add(new Variable("var1", "var1", false, Variable.VarType.CONFIG));
    property.addVariable(expected.get(0));
    expected.add(new Variable("var2", "var2-unredefinable", false, Variable.VarType.CONFIG));
    property.addVariable(expected.get(1));
    expected.add(new Variable("var3", "var3-overridden", false, Variable.VarType.CONFIG));
    property.addVariable(new Variable("var3", "var3", true, Variable.VarType.CONFIG));
    property.addVariable(expected.get(2));
    property.addVariable(new Variable("var2", "var2", false, Variable.VarType.CONFIG));

    List<Variable> templateVars = new ArrayList<Variable>(3);
    templateVars.add(new Variable("var4", "var4", false, Variable.VarType.TEMPLATE));
    templateVars.add(new Variable("var5", "var5", false, Variable.VarType.TEMPLATE));
    templateVars.add(new Variable("var6", "var6", false, Variable.VarType.TEMPLATE));
    assertEquals(property.getConfigVariables(), expected);
  }
View Full Code Here

    assertEquals(property.getConfigVariables(), expected);
  }

  @Test
  public void testAddVariables() {
    property.addVariable(new Variable("var3", "var3", true, Variable.VarType.CONFIG));
    List<Variable> configVars = new ArrayList<Variable>(3);
    configVars.add(new Variable("var3", "var3-overridden", false, Variable.VarType.CONFIG));
    configVars.add(new Variable("var1", "var1", false, Variable.VarType.CONFIG));
    configVars.add(new Variable("var2", "var2-unredefinable", false, Variable.VarType.CONFIG));
    property.addVariables(configVars);
    property.addVariable(new Variable("var2", "var2", false, Variable.VarType.CONFIG));

    property.addVariable(new Variable("var4", "var4", true, Variable.VarType.TEMPLATE));
    List<Variable> templateVars = new ArrayList<Variable>(3);
    templateVars.add(new Variable("var4", "var4-overridden", false, Variable.VarType.TEMPLATE));
    templateVars.add(new Variable("var6", "var6", false, Variable.VarType.TEMPLATE));
    templateVars.add(new Variable("var5", "var5-unredefinable", false, Variable.VarType.TEMPLATE));
    property.addVariables(templateVars);
    property.addVariable(new Variable("var5", "var5", false, Variable.VarType.TEMPLATE));

    assertEquals(property.getConfigVariables(), configVars);
    assertEquals(property.getTemplateVariables(), templateVars);
  }
View Full Code Here

    Object uiParamType = annotationProvider.getValue("type");
    if (uiParamType != null) {
      switch ((UiParamType) uiParamType) {
        case INTEGER:
          AFVariables.add(new Variable(name, Integer.valueOf(stringValue)));
          break;
        case LONG:
          AFVariables.add(new Variable(name, Long.valueOf(stringValue)));
          break;
        case FLOAT:
          AFVariables.add(new Variable(name, Float.valueOf(stringValue)));
          break;
        case DOUBLE:
          AFVariables.add(new Variable(name, Double.valueOf(stringValue)));
          break;
        case BOOLEAN:
          AFVariables.add(new Variable(name, Boolean.valueOf(stringValue)));
          break;
        default:
          AFVariables.add(new Variable(name, stringValue));
      }
    }

    return AFVariables;
  }
View Full Code Here

  }

  @Override
  public List<Variable> getVariables(AnnotationProvider annotationProvider) {
    List<Variable> variables = new ArrayList<Variable>();
    variables.add(new Variable("type", annotationProvider.getValue("value")));
    return variables;
  }
View Full Code Here

    String title = (String) annotationProvider.getValue("title");
    String type = (String) annotationProvider.getValue("type");
    PropertyExtension pe = new PropertyExtension(type, title, value);

    List<Variable> variables = new ArrayList<Variable>();
    variables.add(new Variable("before", pe));
    return variables;
  }
View Full Code Here

    if (params != null) {
      for (UiParam uiParam : params) {
        String name = uiParam.name();
        Object value = uiParam.value();
        variables.add(new Variable(name, value));
      }
    }

    return variables;
  }
View Full Code Here

TOP

Related Classes of com.codingcrayons.aspectfaces.annotation.registration.pointCut.properties.Variable

Copyright © 2018 www.massapicom. 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.