Examples of ValueReference


Examples of javax.el.ValueReference

        ValueExpression ve = factory.createValueExpression(
                context, "${foo}", ValueExpression.class);


        // Now check the value reference
        ValueReference vr = ve.getValueReference(context);
        assertNotNull(vr);

        assertEquals(beanB, vr.getBase());
        assertEquals("name", vr.getProperty());
    }
View Full Code Here

Examples of javax.el.ValueReference

        // First check the basics work
        String result = (String) ve.getValue(context);
        assertEquals("Tomcat", result);

        // Now check the value reference
        ValueReference vr = ve.getValueReference(context);
        assertNotNull(vr);

        assertEquals(beanB, vr.getBase());
        assertEquals("name", vr.getProperty());
    }
View Full Code Here

Examples of javax.el.ValueReference

                this.jjtGetChild(2) instanceof AstMethodParameters) {
            // This is a method call
            return null;
        }
        Target t = getTarget(ctx);
        return new ValueReference(t.base, t.property);
    }
View Full Code Here

Examples of javax.el.ValueReference

     * @return A ValueReferenceWrapper with the necessary information about the ValueReference.
     */
    public static _ValueReferenceWrapper getUELValueReferenceWrapper(ValueExpression valueExpression,
                                                                     final ELContext elCtx)
    {
        ValueReference valueReference = valueExpression.getValueReference(elCtx);
       
        while (valueReference != null
                && valueReference.getBase() instanceof CompositeComponentExpressionHolder)
        {
            valueExpression = ((CompositeComponentExpressionHolder) valueReference.getBase())
                                  .getExpression((String) valueReference.getProperty());
            if(valueExpression == null)
            {
                break;
            }
            valueReference = valueExpression.getValueReference(elCtx);
        }
       
        if (valueReference != null)
        {
            return new _ValueReferenceWrapper(valueReference.getBase(), valueReference.getProperty());
        }
       
        return null;
    }
View Full Code Here

Examples of net.percederberg.mibble.value.ValueReference

     * @throws ParseException if the node analysis discovered errors
     */
    protected Node exitDefinedValue(Production node)
        throws ParseException {

        ValueReference  ref;
        MibContext      local = getContext();
        String          name;
        Node            child;

        // Check for module reference
        child = getChildAt(node, 0);
        if (child.getId() == Asn1Constants.MODULE_REFERENCE) {
            name = getStringValue(child, 0);
            local = currentMib.getImport(name);
            if (local == null) {
                throw new ParseException(
                    ParseException.ANALYSIS_ERROR,
                    "referenced module not imported '" + name + "'",
                    child.getStartLine(),
                    child.getStartColumn());
            }
            child = getChildAt(node, 1);
        }

        // Create value reference
        name = getStringValue(child, 0);
        ref = new ValueReference(getLocation(node), local, name);
        node.addValue(ref);
        return node;
    }
View Full Code Here

Examples of net.percederberg.mibble.value.ValueReference

        for (int i = 0; i < components.size(); i++) {
            number = (NamedNumber) components.get(i);
            if (number.hasNumber()) {
                value = number.getNumber().intValue();
                if (parent == null && value == 0) {
                    parent = new ValueReference(getLocation(node),
                                                getContext(),
                                                DefaultContext.CCITT);
                } else if (parent == null && value == 1) {
                    parent = new ValueReference(getLocation(node),
                                                getContext(),
                                                DefaultContext.ISO);
                } else if (parent == null && value == 2) {
                    parent = new ValueReference(getLocation(node),
                                                getContext(),
                                                DefaultContext.JOINT_ISO_CCITT);
                } else if (parent instanceof ObjectIdentifierValue) {
                    try {
                        parent = new ObjectIdentifierValue(
View Full Code Here

Examples of net.percederberg.mibble.value.ValueReference

    protected Node exitNameOrNumber(Production node)
        throws ParseException {

        NamedNumber     value;
        Object          obj;
        ValueReference  ref;

        obj = getValue(getChildAt(node, 0), 0);
        if (obj instanceof Number) {
            value = new NamedNumber((Number) obj);
        } else if (obj instanceof String) {
            ref = new ValueReference(getLocation(node),
                                     getContext(),
                                     (String) obj);
            value = new NamedNumber((String) obj, ref);
        } else {
            value = (NamedNumber) obj;
View Full Code Here

Examples of org.activiti.engine.impl.javax.el.ValueReference

  protected AstNode getPrefix() {
    return prefix;
  }

  public ValueReference getValueReference(Bindings bindings, ELContext context) {
    return new ValueReference(prefix.eval(bindings, context), getProperty(bindings, context));
  }
View Full Code Here

Examples of org.apache.drill.exec.expr.fn.DrillFuncHolder.ValueReference

   
    // start by getting field information.
    List<ValueReference> params = Lists.newArrayList();
    List<WorkspaceReference> workspaceFields = Lists.newArrayList();
   
    ValueReference outputField = null;
   
   
    for(Field field : clazz.getDeclaredFields()){

      Param param = field.getAnnotation(Param.class);
      Output output = field.getAnnotation(Output.class);
      Workspace workspace = field.getAnnotation(Workspace.class);
     
      int i =0;
      if(param != null) i++;
      if(output != null) i++;
      if(workspace != null) i++;
      if(i == 0){
        return failure("The field must be either a @Param, @Output or @Workspace field.", clazz, field);
      }else if(i > 1){
        return failure("The field must be only one of @Param, @Output or @Workspace.  It currently has more than one of these annotations.", clazz, field);
      }

     
     
      if(param != null || output != null){
       
        // check that param and output are value holders.
        if(!ValueHolder.class.isAssignableFrom(field.getType())){
          return failure(String.format("The field doesn't holds value of type %s which does not implement the ValueHolder interface.  All fields of type @Param or @Output must extend this interface..", field.getType()), clazz, field);
        }
       
        // get the type field from the value holder.
        MajorType type = null;
        try{
          type = getStaticFieldValue("TYPE", field.getType(), MajorType.class);
        }catch(Exception e){
          return failure("Failure while trying to access the ValueHolder's TYPE static variable.  All ValueHolders must contain a static TYPE variable that defines their MajorType.", e, clazz, field.getName());
        }
       
       
        ValueReference p = new ValueReference(type, field.getName());
        if(param != null){
          params.add(p);
        }else{
          if(outputField != null){
            return failure("You've declared more than one @Output field.  You must declare one and only @Output field per Function class.", clazz, field);
View Full Code Here

Examples of org.apache.drill.exec.expr.fn.DrillFuncHolder.ValueReference

    // start by getting field information.
    List<ValueReference> params = Lists.newArrayList();
    List<WorkspaceReference> workspaceFields = Lists.newArrayList();

    ValueReference outputField = null;


    for(Field field : clazz.getDeclaredFields()){

      Param param = field.getAnnotation(Param.class);
      Output output = field.getAnnotation(Output.class);
      Workspace workspace = field.getAnnotation(Workspace.class);

      int i =0;
      if(param != null) i++;
      if(output != null) i++;
      if(workspace != null) i++;
      if(i == 0){
        return failure("The field must be either a @Param, @Output or @Workspace field.", clazz, field);
      }else if(i > 1){
        return failure("The field must be only one of @Param, @Output or @Workspace.  It currently has more than one of these annotations.", clazz, field);
      }

      if(param != null || output != null){

        // Special processing for @Param FieldReader
        if (param != null && FieldReader.class.isAssignableFrom(field.getType())) {
          params.add(ValueReference.createFieldReaderRef(field.getName()));
          continue;
        }

        // Special processing for @Output ComplexWriter
        if (output != null && ComplexWriter.class.isAssignableFrom(field.getType())) {
         
          if(outputField != null){
            return failure("You've declared more than one @Output field.  You must declare one and only @Output field per Function class.", clazz, field);
          }else{
            outputField = ValueReference.createComplexWriterRef(field.getName());
          }
          continue;
        }
       
        // check that param and output are value holders.
        if(!ValueHolder.class.isAssignableFrom(field.getType())){
          return failure(String.format("The field doesn't holds value of type %s which does not implement the ValueHolder interface.  All fields of type @Param or @Output must extend this interface..", field.getType()), clazz, field);
        }

        // get the type field from the value holder.
        MajorType type = null;
        try{
          type = getStaticFieldValue("TYPE", field.getType(), MajorType.class);
        }catch(Exception e){
          return failure("Failure while trying to access the ValueHolder's TYPE static variable.  All ValueHolders must contain a static TYPE variable that defines their MajorType.", e, clazz, field.getName());
        }


        ValueReference p = new ValueReference(type, field.getName());
        if(param != null){
          if (param.constant()) {
            p.setConstant(true);
          }
          params.add(p);
        }else{
          if(outputField != null){
            return failure("You've declared more than one @Output field.  You must declare one and only @Output field per Function class.", clazz, field);
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.