Package com.google.gwt.core.ext.linker.impl

Examples of com.google.gwt.core.ext.linker.impl.NamedRange


public class JsTypeLinkerTest extends TestCase {

  private int lines;

  public void testLink() {
    NamedRange programRange = new NamedRange("Program");
    NamedRange someModelARange = new NamedRange("com.some.app.SomeAModel");
    NamedRange someModelBRange = new NamedRange("com.some.app.SomeBModel");
    NamedRange someControllerRange = new NamedRange("com.some.app.SomeController");
    NamedRange entryPointRange = new NamedRange("com.some.app.EntryPoint");
    List<NamedRange> classRanges =
        Lists.newArrayList(someModelARange, someModelBRange, someControllerRange, entryPointRange);
    StatementRangesBuilder srb = new StatementRangesBuilder();
    JsSourceMapBuilder smb = new JsSourceMapBuilder();
View Full Code Here


    }
    assertTrue(classRangesByName.containsKey("test.EntryPoint"));
    assertTrue(classRangesByName.containsKey("test.EntryPoint$SomeInterface"));
    assertTrue(classRangesByName.size() > 2);

    NamedRange programClassRange = jsSourceGenerationVisitor.getProgramClassRange();
    // Verifies there is a preamble before the program class range.
    assertTrue(programClassRange.getStartPosition() > 0);
    // Verifies there is an epilogue after the program class range.
    assertTrue(programClassRange.getEndPosition() < text.getPosition());
  }
View Full Code Here

    switch (x.getType()) {
      case CLASS_START:
        assert currentClassRange
            == null : "Class start and end boundaries must be matched and not nested.";
        currentClassRange = new NamedRange(x.getName());
        currentClassRange.setStartPosition(p.getPosition());
        currentClassRange.setStartLineNumber(p.getLine());
        break;
      case CLASS_END:
        assert currentClassRange
            != null : "Class start and end boundaries must be matched and not nested.";
        currentClassRange.setEndPosition(p.getPosition());
        currentClassRange.setEndLineNumber(p.getLine());
        classRanges.add(currentClassRange);
        currentClassRange = null;
        break;
      case PROGRAM_START:
        programClassRange = new NamedRange("Program");
        programClassRange.setStartPosition(p.getPosition());
        programClassRange.setStartLineNumber(p.getLine());
        break;
      case PROGRAM_END:
        assert programClassRange != null : "Program start and end boundaries must be matched.";
View Full Code Here

    super(textTransformer);
    this.logger = logger;
    this.statementRangesExtractor = new StatementRangesExtractor(statementRanges);
    this.jsSourceMapExtractor = sourceInfoMap.createExtractor();
    this.typeRanges = typeRanges;
    this.headerRange = new NamedRange(HEADER_NAME, 0, programTypeRange.getStartPosition(), 0,
        programTypeRange.getStartLineNumber());
    this.footerRange = new NamedRange(FOOTER_NAME, programTypeRange.getEndPosition(), js.length(),
        programTypeRange.getEndLineNumber(), sourceInfoMap.getLines());
    this.minimalRebuildCache = minimalRebuildCache;
    this.typeOracle = typeOracle;

    // Presize the jsBuilder to avoid content copying during expansion.
View Full Code Here

TOP

Related Classes of com.google.gwt.core.ext.linker.impl.NamedRange

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.