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

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


        + "title=\"#{text['tooltip.person.name']}\"\n" + "pattern=\"''\"\n" + "minlength=\"ee\"\n"
        + "maxlength=\"\"\n" + "rendered=\"#{empty renderNAME ? 'true' : renderName}\"\n"
        + "id=\"#{prefix}name\" />";

      List<Variable> vars = new ArrayList<Variable>();
      vars.add(new Variable("entityBeanLower", "person"));
      vars.add(new Variable("field", "name"));
      vars.add(new Variable("value", "instance.name"));
      vars.add(new Variable("notNull", "false"));
      vars.add(new Variable("size", "100"));
      vars.add(new Variable("minLength", null));

      TagVariableResolver resolver = new TagVariableResolver();
      StringBuilder output = resolver.resolve("Test.xhtml", template, "$", "$", vars);
      assertEquals(output.toString(), expected);
    } catch (TagParserException ex) {
View Full Code Here


        + "title=\"#{text['tooltip.person.name']}\"\n" + "pattern=\"''\"\n" + "minlength=\"ee\"\n"
        + "maxlength=\"\"\n" + "rendered=\"#{empty renderNAME ? 'true' : renderName}\"\n"
        + "id=\"#{prefix}name\" />";

      List<Variable> vars = new ArrayList<Variable>();
      vars.add(new Variable("entityBeanLower", "person"));
      vars.add(new Variable("field", "name"));
      vars.add(new Variable("value", "instance.name"));
      vars.add(new Variable("notNull", "false"));
      vars.add(new Variable("size", "100"));
      vars.add(new Variable("minLength", null));

      TagVariableResolver resolver = new TagVariableResolver();
      StringBuilder output = resolver.resolve("Test.xhtml", template, "@{", "}", vars);
      assertEquals(output.toString(), expected);
    } catch (TagParserException ex) {
View Full Code Here

  }

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

   * @see Constants
   * @see VariableJoinPoint
   * @see Variable
   */
  private void setDefaultVariables() {
    metaProperty.addVariable(new Variable(Constants.V_ENTITY_BEAN, this.metaProperty.getMetaEntity().getName()));
    metaProperty.addVariable(new Variable(Constants.V_DATA_TYPE, Strings.lowerFirstLetter(this.metaProperty.getReturnType())));
    metaProperty.addVariable(new Variable(Constants.V_LABEL, this.createLabel()));
    metaProperty.addVariable(new Variable(Constants.V_FIELD, this.metaProperty.getName()));
    metaProperty.addVariable(new Variable(Constants.V_INSTANCE, this.createInstance()));
    metaProperty.addVariable(new Variable(Constants.V_VALUE, this.createValue()));
    metaProperty.addVariable(new Variable(Constants.DEFAULT_REQUIRED, false));
    // syntax sugar
    metaProperty.addVariable(new Variable(Constants.V_CDATA_TYPE, this.metaProperty.getReturnType()));
    metaProperty.addVariable(new Variable(Constants.V_FIELDNAME, Strings.lowerFirstLetter(this.metaProperty.getName())));
    metaProperty.addVariable(new Variable(Constants.V_CFIELDNAME, Strings.upperFirstLetter(this.metaProperty.getName())));
    metaProperty.addVariable(new Variable(Constants.V_CLASSNAME, Strings.lowerFirstLetter(this.metaProperty.getMetaEntity().getSimpleName())));
    metaProperty.addVariable(new Variable(Constants.V_CCLASSNAME, Strings.upperFirstLetter(this.metaProperty.getMetaEntity().getSimpleName())));
    metaProperty.addVariable(new Variable(Constants.V_FULLCLASSNAME, this.metaProperty.getMetaEntity().getName().toLowerCase()));
    metaProperty.addVariable(new Variable(Constants.V_CFULLCLASSNAME, this.metaProperty.getMetaEntity().getName()));

    // add variables defined in configuration mapping
    metaProperty.addVariables(context.getConfiguration().getDefaultVariables(metaProperty));
  }
View Full Code Here

   *
   * @return MetaProperty with before info
   */
  public MetaProperty getMetaPropertyBefore() {

    Variable before = metaProperty.getVariable("before");

    if (before != null) {
      MetaProperty m = new MetaProperty(getMetaProperty().getMetaEntity(),
        "Insert", "before", getMetaProperty().getOrder() - SMALL_DELTA, null);
      m.setApplicable(true);
      m.addVariable(before);
      m.addVariable(new Variable(Constants.V_ENTITY_BEAN, this.metaProperty.getMetaEntity().getName()));
      return m;
    }
    return null;
  }
View Full Code Here

   *
   * @return MetaProperty with after info
   */
  public MetaProperty getMetaPropertyAfter() {

    Variable after = metaProperty.getVariable("after");

    if (after != null) {
      MetaProperty m = new MetaProperty(getMetaProperty().getMetaEntity(),
        "Insert", "after", getMetaProperty().getOrder() + SMALL_DELTA, null);
      m.setApplicable(true);
      m.addVariable(after);
      m.addVariable(new Variable(Constants.V_ENTITY_BEAN, this.metaProperty.getMetaEntity().getName()));
      return m;
    }
    return null;
  }
View Full Code Here

  private StringBuilder createUnboundUIFragment(String tagName, StringBuilder uiFragment, Context context)
    throws TemplateFileAccessException, EvaluatorException, TagParserException {

    List<Variable> localVars = Collections.concatList(context.getVariableList(),
      new Variable(V_FRAGMENT, context.getFragmentName()));
    return initUIFragment(tagName, uiFragment, localVars);
  }
View Full Code Here

  @Test
  public void testCreateDefault() {
    String name = "name";
    String value = "value";
    var = new Variable(name, value);
    assertEquals(var.getName(), name);
    assertEquals(var.getValue(), value);
    assertTrue(var.isRedefinable());
  }
View Full Code Here

  @Test
  public void testCreate() {
    String name = "name";
    String value = "value";
    boolean redefinable = false;
    var = new Variable(name, value, redefinable);
    assertEquals(var.getName(), name);
    assertEquals(var.getValue(), value);
    assertFalse(var.isRedefinable());
  }
View Full Code Here

  }

  @Override
  public List<Variable> getVariables(AnnotationProvider annotationProvider) {
    List<Variable> variables = new ArrayList<Variable>();
    variables.add(new Variable("text", true));
    variables.add(new Variable("cols", annotationProvider.getValue("cols")));
    variables.add(new Variable("rows", annotationProvider.getValue("rows")));
    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.