Package org.mvel2.integration

Examples of org.mvel2.integration.PropertyHandler


      }
    }
  }

  private Object propHandlerByteCode(String property, Object ctx, Class handler) {
    PropertyHandler ph = getPropertyHandler(handler);
    if (ph instanceof ProducesBytecode) {
      assert debug("<<3rd-Party Code Generation>>");
      ((ProducesBytecode) ph).produceBytecodeGet(mv, property, variableFactory);
      return ph.getProperty(property, ctx, variableFactory);
    }
    else {
      throw new RuntimeException("unable to compileShared: custom accessor does not support producing bytecode: "
          + ph.getClass().getName());
    }
  }
View Full Code Here


          + ph.getClass().getName());
    }
  }

  private void propHandlerByteCodePut(String property, Object ctx, Class handler, Object value) {
    PropertyHandler ph = getPropertyHandler(handler);
    if (ph instanceof ProducesBytecode) {
      assert debug("<<3rd-Party Code Generation>>");
      ((ProducesBytecode) ph).produceBytecodePut(mv, property, variableFactory);
      ph.setProperty(property, ctx, variableFactory, value);
    }
    else {
      throw new RuntimeException("unable to compileShared: custom accessor does not support producing bytecode: "
          + ph.getClass().getName());
    }
  }
View Full Code Here

  public boolean isLiteralOnly() {
    return literal;
  }

  private Object propHandler(String property, Object ctx, Class handler) {
    PropertyHandler ph = getPropertyHandler(handler);
    addAccessorNode(new PropertyHandlerAccessor(property, handler, ph));
    return ph.getProperty(property, ctx, variableFactory);
  }
View Full Code Here

    addAccessorNode(new PropertyHandlerAccessor(property, handler, ph));
    return ph.getProperty(property, ctx, variableFactory);
  }

  public void propHandlerSet(String property, Object ctx, Class handler, Object value) {
    PropertyHandler ph = getPropertyHandler(handler);
    addAccessorNode(new PropertyHandlerAccessor(property, handler, ph));
    ph.setProperty(property, ctx, variableFactory, value);
  }
View Full Code Here

    else {
      cls = null;
    }

    if (hasPropertyHandler(cls)) {
      PropertyHandler prop = getPropertyHandler(cls);
      if (prop instanceof ProducesBytecode) {
        ((ProducesBytecode) prop).produceBytecodeGet(mv, property, variableFactory);
        return prop.getProperty(property, ctx, variableFactory);
      }
      else {
        throw new RuntimeException("unable to compileShared: custom accessor does not support producing bytecode: "
            + prop.getClass().getName());
      }
    }

    Member member = cls != null ? getFieldOrAccessor(cls, property) : null;
View Full Code Here

      }
    }
  }

  private Object propHandlerByteCode(String property, Object ctx, Class handler) {
    PropertyHandler ph = getPropertyHandler(handler);
    if (ph instanceof ProducesBytecode) {
      assert debug("<<3rd-Party Code Generation>>");
      ((ProducesBytecode) ph).produceBytecodeGet(mv, property, variableFactory);
      return ph.getProperty(property, ctx, variableFactory);
    }
    else {
      throw new RuntimeException("unable to compileShared: custom accessor does not support producing bytecode: "
          + ph.getClass().getName());
    }
  }
View Full Code Here

          + ph.getClass().getName());
    }
  }

  private void propHandlerByteCodePut(String property, Object ctx, Class handler, Object value) {
    PropertyHandler ph = getPropertyHandler(handler);
    if (ph instanceof ProducesBytecode) {
      assert debug("<<3rd-Party Code Generation>>");
      ((ProducesBytecode) ph).produceBytecodePut(mv, property, variableFactory);
      ph.setProperty(property, ctx, variableFactory, value);
    }
    else {
      throw new RuntimeException("unable to compileShared: custom accessor does not support producing bytecode: "
          + ph.getClass().getName());
    }
  }
View Full Code Here

        // Set pattern offset to the appropriate value
        pattern.setOffset( context.getCurrentPatternOffset() );
       
        // this is needed for Activation patterns, to allow declarations and annotations to be used like field constraints
        if ( ClassObjectType.Activation_ObjectType.isAssignableFrom( pattern.getObjectType() ) ) {
            PropertyHandler handler = PropertyHandlerFactory.getPropertyHandler( AgendaItem.class );
            if ( handler == null ) {
                PropertyHandlerFactoryFixer.getPropertyHandlerClass().put( AgendaItem.class, new ActivationPropertyHandler() );
            }
        }
View Full Code Here

        // Set pattern offset to the appropriate value
        pattern.setOffset( context.getCurrentPatternOffset() );
       
        // this is needed for Activation patterns, to allow declarations and annotations to be used like field constraints
        if ( ClassObjectType.Match_ObjectType.isAssignableFrom( pattern.getObjectType() ) ) {
            PropertyHandler handler = PropertyHandlerFactory.getPropertyHandler( AgendaItemImpl.class );
            if ( handler == null ) {
                PropertyHandlerFactoryFixer.getPropertyHandlerClass().put( AgendaItemImpl.class, new ActivationPropertyHandler() );
            }
        }
View Full Code Here

                                   objectType,
                                   null );
        }

        if ( ClassObjectType.Match_ObjectType.isAssignableFrom( pattern.getObjectType() ) ) {
            PropertyHandler handler = PropertyHandlerFactory.getPropertyHandler( RuleTerminalNodeLeftTuple.class );
            if ( handler == null ) {
                PropertyHandlerFactoryFixer.getPropertyHandlerClass().put( RuleTerminalNodeLeftTuple.class,
                                                                           new ActivationPropertyHandler() );
            }
        }
View Full Code Here

TOP

Related Classes of org.mvel2.integration.PropertyHandler

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.