Examples of FieldAccess


Examples of org.apache.tapestry5.services.FieldAccess

        TransformMethodSignature getter = new TransformMethodSignature(Modifier.PUBLIC, field.getType(), "get"
                + propertyName, null, null);

        ensureNotOverride(transformation, getter);

        final FieldAccess access = field.getAccess();

        transformation.getOrCreateMethod(getter).addAdvice(new ComponentMethodAdvice()
        {
            public void advise(ComponentMethodInvocation invocation)
            {
                invocation.overrideResult(access.read(invocation.getInstance()));
            }
        });
    }
View Full Code Here

Examples of org.apache.tapestry5.services.FieldAccess

    private void transformField(ClassTransformation transformation, MutableComponentModel model, TransformField field)
    {
        PageActivationContext annotation = field.getAnnotation(PageActivationContext.class);

        FieldAccess access = field.getAccess();

        if (annotation.activate())
        {
            transformation.addComponentEventHandler(EventConstants.ACTIVATE, 1,
                    "PageActivationContextWorker activate event handler",
View Full Code Here

Examples of org.apache.tapestry5.services.FieldAccess

        List<String> expandedPaths = expandSymbolsInPaths(assetPaths);

        // Since every instance of the component will be in a different locale, every instance
        // will have a field to store its localized list of assets.

        FieldAccess access = createFieldForAssets(transformation);

        // Inside the component's page loaded callback, convert the asset paths to assets

        storeLocalizedAssetsAtPageLoad(transformation, model.getBaseResource(), expandedPaths, access);
View Full Code Here

Examples of org.candle.decompiler.intermediate.expression.FieldAccess

    String fieldName = instruction.getFieldName(cpg);
   
    Expression right = context.getExpressions().pop();
    Expression left = context.getExpressions().pop();
   
    FieldAccess fieldRef = new FieldAccess(context.getCurrentInstruction(), left, fieldName);
    Assignment assignment = new Assignment(context.getCurrentInstruction(), fieldRef, right);
   
    StatementIntermediate complete = new StatementIntermediate(context.getCurrentInstruction(), assignment);
   
    context.pushIntermediateToInstruction(complete);
View Full Code Here

Examples of org.candle.decompiler.intermediate.expression.FieldAccess

   
   
    MethodGen mg = context.getMethodGen();
    ConstantPoolGen cpg = mg.getConstantPool();
   
    FieldAccess ref = new FieldAccess(context.getCurrentInstruction(), target, instruction.getFieldName(cpg));
    context.getExpressions().push(ref);
  }
View Full Code Here

Examples of org.codehaus.janino.Java.FieldAccess

            List l = (List) this.singleStaticImports.get(identifier);
            if (l != null) {
                for (Iterator it = l.iterator(); it.hasNext();) {
                    Object o = it.next();
                    if (o instanceof IField) {
                        FieldAccess fieldAccess = new FieldAccess(
                            location,
                            new SimpleType(location, ((IField) o).getDeclaringIClass()),
                            (IField) o
                        );
                        fieldAccess.setEnclosingBlockStatement(enclosingBlockStatement);
                        return fieldAccess;
                    }
                }
            }
        }

        // JLS3 6.5.2.BL1.B1.B2.2 Static field imported through static-import-on-demand.
        {
            IField importedField = null;
            for (Iterator it = this.staticImportsOnDemand.iterator(); it.hasNext();) {
                IClass iClass = (IClass) it.next();
                IField f = iClass.getDeclaredIField(identifier);
                if (f != null) {
                        // JLS3 7.5.4 Static-Import-on-Demand Declaration
                        if (!UnitCompiler.this.isAccessible(f, enclosingBlockStatement)) continue;

                        if (importedField != null) {
                            UnitCompiler.this.compileError(
                                "Ambiguous static field import: \""
                                + importedField.toString()
                                + "\" vs. \""
                                + f.toString()
                                + "\""
                            );
                        }
                        importedField = f;
                    }
                }
            if (importedField != null) {
                if (!importedField.isStatic()) UnitCompiler.this.compileError("Cannot static-import non-static field");
                FieldAccess fieldAccess = new FieldAccess(
                    location,
                    new SimpleType(location, importedField.getDeclaringIClass()),
                    importedField
                );
                fieldAccess.setEnclosingBlockStatement(enclosingBlockStatement);
                return fieldAccess;
            }
        }

        // Hack: "java" MUST be a package, not a class.
View Full Code Here

Examples of org.datanucleus.enhancer.samples.FieldAccess

{
    public void testFieldAccess()
    {
        FieldAccess.DataHolder dh = new FieldAccess.DataHolder();
        dh.temp = "test1";
        FieldAccess fa = new FieldAccess();
        fa.id = 3;
        assertEquals(dh.temp,fa.getFieldValueNav1(dh));
        assertEquals(dh.temp,fa.getFieldValueNav2(dh));
        assertEquals(dh.temp,fa.getFieldValueNav3(dh));
        assertEquals(3,FieldAccess.getFieldValueNav4(new FieldAccess.Id("3")));
        assertEquals(4,FieldAccess.getFieldValueNav5(new FieldAccess.Id("4")));
        assertEquals(5,FieldAccess.getFieldValueNav6(new FieldAccess.Id("5")));
        assertEquals(6,FieldAccess.getFieldValueNav7(fa,new FieldAccess.Id("6")));
        assertEquals(7,fa.getFieldValueNav8(new FieldAccess.Id("7")));
        assertEquals(8,fa.getFieldValueNav9(new FieldAccess.Id("8")));
        assertEquals(9,fa.getFieldValueNav10(new FieldAccess.Id("9")));
        assertEquals(10,fa.getFieldValueNav11(new FieldAccess.Id("10")));
        assertEquals(11,fa.getFieldValueNav12(new FieldAccess.Id("11")));
        assertEquals(12,fa.getFieldValueNav13(new FieldAccess.Id("12")));
        assertEquals(13,fa.getFieldValueNav14(new FieldAccess.Id("13")));
        assertEquals(14,fa.getFieldValueNav15(new FieldAccess.Id("14")));
        assertEquals(15,fa.getFieldValueNav16(new FieldAccess.Id("15")));
        fa.id = 4;
        assertEquals(5,fa.getFieldValueNav17());
        assertEquals(6,fa.getFieldValueNav17());
        assertEquals(7,fa.getFieldValueNav18());
        assertEquals(8,fa.getFieldValueNav18());
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.FieldAccess

     * @param fname
     */
    public void addAssignVariableToField(String vname, String fname) {
        Assignment asgn = m_ast.newAssignment();
        if (fname.equals(vname)) {
            FieldAccess access = m_ast.newFieldAccess();
            access.setExpression(m_ast.newThisExpression());
            access.setName(m_ast.newSimpleName(fname));
            asgn.setLeftHandSide(access);
        } else {
            asgn.setLeftHandSide(m_ast.newSimpleName(fname));
        }
        asgn.setRightHandSide(m_ast.newSimpleName(vname));
View Full Code Here

Examples of org.eclipse.jdt.core.dom.FieldAccess

     */
    public void addIndexedForStatement(String name, String array, BlockBuilder block) {
        InfixExpression test = m_ast.newInfixExpression();
        test.setOperator(Operator.LESS);
        test.setLeftOperand(m_ast.newSimpleName(name));
        FieldAccess access = m_ast.newFieldAccess();
        access.setExpression(m_ast.newSimpleName(array));
        access.setName(m_ast.newSimpleName("length"));
        test.setRightOperand(access);
        PrefixExpression post = m_ast.newPrefixExpression();
        post.setOperator(PrefixExpression.Operator.INCREMENT);
        post.setOperand(m_ast.newSimpleName(name));
        addForStatement(name, m_ast.newPrimitiveType(PrimitiveType.INT), m_ast.newNumberLiteral("0"), test,
View Full Code Here

Examples of org.eclipse.jdt.core.dom.FieldAccess

    if (optional == null) {
      return adaptable.isRoot();
    } else if (optional instanceof ThisExpression) {
      return adaptable.isRoot();
    } else if (optional instanceof FieldAccess) {
      FieldAccess fieldAccess = (FieldAccess) optional;
      Expression accessExpression = fieldAccess.getExpression();
      if (accessExpression instanceof SimpleName) {
        String fieldName = ((SimpleName) accessExpression).getFullyQualifiedName();
        if (fieldName.equals(adaptable.getName()))
          return true;
      }
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.