Package org.codehaus.groovy.ast.expr

Examples of org.codehaus.groovy.ast.expr.PropertyExpression


        Variable v = null;
        if (expression instanceof VariableExpression) {
            VariableExpression ve = (VariableExpression) expression;
            v = ve.getAccessedVariable();
        } else {
          PropertyExpression propExp = ((PropertyExpression) expression);
          Expression objectExpression = propExp.getObjectExpression();
          if(objectExpression instanceof VariableExpression) {
            VariableExpression varExp = (VariableExpression) objectExpression;
            if(varExp.isThisExpression()) {
              v = currentClass.getDeclaredField(propExp.getPropertyAsString());
            }
          }
        }
        if (v instanceof FieldNode) {
            FieldNode fn = (FieldNode) v;
View Full Code Here


        Expression argsExp = call.getArguments();
        if (argsExp instanceof TupleExpression) {
            TupleExpression argsListExp = (TupleExpression) argsExp;
            Expression this0 = VariableExpression.THIS_EXPRESSION;
            for (int i = 0; i != level; ++i)
                this0 = new PropertyExpression(this0, "this$0");
            argsListExp.getExpressions().add(0, this0);
        }
    }
View Full Code Here

         MethodCallExpression mce = (MethodCallExpression)expression;

         //
         if (mce.getObjectExpression() instanceof PropertyExpression)
         {
            PropertyExpression mce_pe = (PropertyExpression)mce.getObjectExpression();

            //
            Expression expr = bilto(mce_pe);
            if (expr != null)
            {
View Full Code Here

      }
      else
      {
         Expression left = createExpr(packageName.subList(0, packageName.size() - 1));
         ConstantExpression right = new ConstantExpression(packageName.get(packageName.size() - 1));
         return new PropertyExpression(left, right);
      }
   }
View Full Code Here

         String name = ((VariableExpression)exp).getName();
         mapmap = getSubPackage(name);
      }
      else if (exp instanceof PropertyExpression)
      {
         PropertyExpression pe = (PropertyExpression)exp;
         if (pe.getObjectExpression() instanceof VariableExpression)
         {
            mapmap = map(pe.getObjectExpression());
         }
         else if (pe.getObjectExpression() instanceof PropertyExpression)
         {
            PropertyExpression pe_pe = (PropertyExpression)pe.getObjectExpression();
            mapmap = map(pe_pe);
         }
         else
         {
            //
View Full Code Here

         String name = ((VariableExpression)expr).getName();
         accept(name);
      }
      else if (expr instanceof PropertyExpression)
      {
         PropertyExpression pe = (PropertyExpression)expr;
         visit(pe.getObjectExpression());
         ConstantExpression pe_ce = (ConstantExpression)pe.getProperty();
         accept((String)pe_ce.getValue());
      }
      else
      {
         throw new UnsupportedOperationException("Do not support expression of type" + expr + " with text "
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.ast.expr.PropertyExpression

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.