コード例 #1
0
  public void test_isMoreSpecificThan_typeArguments_transitivity_interfaceTypes() {
    //  class A {}
    //  class B extends A {}
    //
    ClassElement classA = classElement("A");
    ClassElement classB = classElement("B", classA.getType());
    InterfaceType typeA = classA.getType();
    InterfaceType typeB = classB.getType();

    TypeParameterElementImpl typeParameterT = new TypeParameterElementImpl(identifier("T"));
    typeParameterT.setBound(typeB);
    TypeParameterTypeImpl typeParameterTypeT = new TypeParameterTypeImpl(typeParameterT);

    // <T extends B>
    // T << A
    assertTrue(typeParameterTypeT.isMoreSpecificThan(typeA));
  }
コード例 #2
0
 @Override
 public void apply(AngularHtmlUnitResolver resolver, XmlTagNode node) {
   InterfaceType type = element.getType();
   LocalVariableElementImpl variable = resolver.createLocalVariable(type, name);
   resolver.defineVariable(variable);
 }