Examples of JClassType


Examples of com.google.gwt.core.ext.typeinfo.JClassType

    private void detectBadProperties(ConnectorBundle bundle, TreeLogger logger)
            throws UnableToCompleteException {
        Map<JClassType, Set<String>> definedProperties = new HashMap<JClassType, Set<String>>();

        for (Property property : bundle.getNeedsProperty()) {
            JClassType beanType = property.getBeanType();
            Set<String> usedPropertyNames = definedProperties.get(beanType);
            if (usedPropertyNames == null) {
                usedPropertyNames = new HashSet<String>();
                definedProperties.put(beanType, usedPropertyNames);
            }

            String name = property.getName();
            if (!usedPropertyNames.add(name)) {
                logger.log(Type.ERROR, beanType.getQualifiedSourceName()
                        + " has multiple properties with the name " + name
                        + ". This can happen if there are multiple "
                        + "setters with identical names ignoring case.");
                throw new UnableToCompleteException();
            }
            if (!property.hasAccessorMethods()) {
                logger.log(Type.ERROR, beanType.getQualifiedSourceName()
                        + " has the property '" + name
                        + "' without getter defined.");
                throw new UnableToCompleteException();
            }
        }
View Full Code Here

Examples of com.google.gwt.dev.javac.typemodel.JClassType

  public void testLookup() throws NotFoundException {
    JavaSourceParser parser = new JavaSourceParser();
    addGeneratedUnits(FOO);
    addGeneratedUnits(BAR);
    addGeneratedUnits(BAZ);
    JClassType string = state.getTypeOracle().getType("java.lang.String");
    JClassType foo = state.getTypeOracle().getType("test.Foo");
    parser.addSourceForType(foo, FOO);
    JClassType bar = state.getTypeOracle().getType("test.Bar");
    parser.addSourceForType(bar, BAR);
    JClassType baz = state.getTypeOracle().getType("test.Baz");
    parser.addSourceForType(baz, BAZ);
    JClassType baz1 = state.getTypeOracle().getType("test.Baz.Baz1");
    JClassType baz2 = state.getTypeOracle().getType("test.Baz.Baz2");
    JMethod method = foo.getMethod("value", new JType[]{
        string, JPrimitiveType.INT});
    String[] arguments = parser.getArguments(method);
    assertNotNull(arguments);
    assertEquals(2, arguments.length);
    assertEquals("a", arguments[0]);
    assertEquals("val", arguments[1]);
    method = bar.getMethod("value", new JType[]{string, JPrimitiveType.INT});
    arguments = parser.getArguments(method);
    assertNotNull(arguments);
    assertEquals(2, arguments.length);
    assertEquals("a", arguments[0]);
    assertEquals("val", arguments[1]);
    method = bar.getMethod("value", new JType[]{JPrimitiveType.INT});
    arguments = parser.getArguments(method);
    assertNotNull(arguments);
    assertEquals(1, arguments.length);
    assertEquals("val", arguments[0]);
    method = bar.getMethod("value", new JType[]{string});
    arguments = parser.getArguments(method);
    assertNotNull(arguments);
    assertEquals(1, arguments.length);
    assertEquals("a", arguments[0]);
    method = baz1.getMethod("value", new JType[]{JPrimitiveType.INT});
    arguments = parser.getArguments(method);
    assertNotNull(arguments);
    assertEquals(1, arguments.length);
    assertEquals("val", arguments[0]);
    method = baz1.getMethod("value", new JType[]{string});
    arguments = parser.getArguments(method);
    assertNotNull(arguments);
    assertEquals(1, arguments.length);
    assertEquals("a", arguments[0]);
    method = baz2.getMethod("value", new JType[]{JPrimitiveType.INT});
    arguments = parser.getArguments(method);
    assertNotNull(arguments);
    assertEquals(1, arguments.length);
    assertEquals("val", arguments[0]);
    method = baz2.getMethod("value", new JType[]{string});
    arguments = parser.getArguments(method);
    assertNotNull(arguments);
    assertEquals(1, arguments.length);
    assertEquals("a", arguments[0]);
  }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JClassType

      logger.log(TreeLogger.ERROR, "Module entry point class '"
          + originalMainClassName + "' must be a class", null);
      throw new UnableToCompleteException();
    }

    JClassType entryClass = (JClassType) reboundEntryType;
    if (entryClass.isAbstract()) {
      logger.log(TreeLogger.ERROR, "Module entry point class '"
          + originalMainClassName + "' must not be abstract", null);
      throw new UnableToCompleteException();
    }
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.