Package org.eclipse.jdt.internal.compiler.lookup

Examples of org.eclipse.jdt.internal.compiler.lookup.Scope$Substitutor


        catch ( IllegalArgumentException e )
        {
            // OK
        }

        Substitutor a = new SubstitutorStub( "XYZ", "", "a", "", "abc" );

        try
        {
            new CompoundSubstitutor( a, null );
            fail();
View Full Code Here


    }

    @Test
    public void testChaining()
    {
        Substitutor a = new SubstitutorStub( "XYZ", "", "a", "", "abc" );
        Substitutor b = new SubstitutorStub( "STU", "", "b", "", "bcd" );

        Substitutor test = new CompoundSubstitutor( a, b );

        AttributesImpl attribFixture = new AttributesImpl( attrib );
        attribFixture.addAttribute( "", "a", ":a", "", "abc" );
        attribFixture.addAttribute( "", "b", ":b", "", "bcd" );

        assertTrue( areEqual( test.substitute( attrib ), attribFixture ) );
        assertEquals( test.substitute( bodyText ), "STU" );
    }
View Full Code Here

        assertEquals( "Unsubstituted body text", "Do you feel luck punk?", tsr.body );
        assertEquals( "Unsubstituted number of attributes", 2, tsr.attributes.getLength() );
        assertEquals( "Unsubstituted forname attribute value", "Dirty", tsr.attributes.getValue( "forname" ) );
        assertEquals( "Unsubstituted surname attribute value", "Harry", tsr.attributes.getValue( "surname" ) );

        digester.setSubstitutor( new Substitutor()
        {
            @Override
            public Attributes substitute( Attributes attributes )
            {
                AttributesImpl results = new AttributesImpl();
View Full Code Here

        assertEquals( "Unsubstituted body text", "Do you feel luck punk?", tsr.body );
        assertEquals( "Unsubstituted number of attributes", 2, tsr.attributes.getLength() );
        assertEquals( "Unsubstituted forname attribute value", "Dirty", tsr.attributes.getValue( "forname" ) );
        assertEquals( "Unsubstituted surname attribute value", "Harry", tsr.attributes.getValue( "surname" ) );

        digester.setSubstitutor( new Substitutor()
        {
            @Override
            public Attributes substitute( Attributes attributes )
            {
                AttributesImpl results = new AttributesImpl();
View Full Code Here

        catch ( IllegalArgumentException e )
        {
            // OK
        }

        Substitutor a = new SubstitutorStub( "XYZ", "", "a", "", "abc" );

        try
        {
            new CompoundSubstitutor( a, null );
            fail();
View Full Code Here

    }

    @Test
    public void testChaining()
    {
        Substitutor a = new SubstitutorStub( "XYZ", "", "a", "", "abc" );
        Substitutor b = new SubstitutorStub( "STU", "", "b", "", "bcd" );

        Substitutor test = new CompoundSubstitutor( a, b );

        AttributesImpl attribFixture = new AttributesImpl( attrib );
        attribFixture.addAttribute( "", "a", ":a", "", "abc" );
        attribFixture.addAttribute( "", "b", ":b", "", "bcd" );

        assertTrue( areEqual( test.substitute( attrib ), attribFixture ) );
        assertEquals( test.substitute( bodyText ), "STU" );
    }
View Full Code Here

  public static final String REBIND_MAGIC_METHOD = "create";
  public static final String ASYNC_MAGIC_METHOD = "runAsync";

  public static void reportRebindProblem(MessageSendSite site, String message) {
    MessageSend messageSend = site.messageSend;
    Scope scope = site.scope;
    // Safe since CUS.referenceContext is set in its constructor.
    CompilationUnitDeclaration cud = scope.compilationUnitScope().referenceContext;
    GWTProblem.recordError(messageSend, cud, message, null);
  }
View Full Code Here

  public static final String REBIND_MAGIC_METHOD = "create";
  public static final String ASYNC_MAGIC_METHOD = "runAsync";

  public static void reportRebindProblem(MessageSendSite site, String message) {
    MessageSend messageSend = site.messageSend;
    Scope scope = site.scope;
    // Safe since CUS.referenceContext is set in its constructor.
    CompilationUnitDeclaration cud = scope.compilationUnitScope().referenceContext;
    GWTProblem.recordInCud(messageSend, cud, message, null);
  }
View Full Code Here

    CompilationUnitDeclaration previousUnitBeingCompleted = this.lookupEnvironment.unitBeingCompleted;
    this.lookupEnvironment.unitBeingCompleted = this.compilationUnitDeclaration;
    try {
      this.hasComputedVisibleElementBindings = true;
 
      Scope scope = this.assistScope;
      ASTNode astNode = this.assistNode;
      boolean notInJavadoc = this.completionContext.javadoc == 0;
 
      this.visibleLocalVariables = new ObjectVector();
      this.visibleFields = new ObjectVector();
      this.visibleMethods = new ObjectVector();
 
      ReferenceContext referenceContext = scope.referenceContext();
      if (referenceContext instanceof AbstractMethodDeclaration) {
        // completion is inside a method body
        searchVisibleVariablesAndMethods(scope, this.visibleLocalVariables, this.visibleFields, this.visibleMethods, notInJavadoc);
      } else if (referenceContext instanceof TypeDeclaration) {
        TypeDeclaration typeDeclaration = (TypeDeclaration) referenceContext;
View Full Code Here

    InvocationSite invocationSite = CompletionEngine.FakeInvocationSite;

    boolean staticsOnly = false;
    // need to know if we're in a static context (or inside a constructor)

    Scope currentScope = scope;

    done1 : while (true) { // done when a COMPILATION_UNIT_SCOPE is found

      switch (currentScope.kind) {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.lookup.Scope$Substitutor

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.