Examples of ClassDeclaration


Examples of com.asakusafw.utils.java.model.syntax.ClassDeclaration

                    .Public()
                    .toAttributes(),
                className,
                Collections.<FormalParameterDeclaration>emptyList(),
                Collections.singletonList(ctorChain));
        ClassDeclaration typeDecl = f.newClassDeclaration(
                new JavadocBuilder(f)
                    .toJavadoc(),
                new AttributeBuilder(f)
                    .annotation(importer.toType(TraceLocation.class), createTraceLocationElements())
                    .Public()
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.ClassDeclaration

            new Generator(context, model).emit();
            return context.getQualifiedTypeName();
        }

        private void emit() throws IOException {
            ClassDeclaration decl = f.newClassDeclaration(
                    new JavadocBuilder(f)
                        .text("Hive ORCFile data format for ") //$NON-NLS-1$
                        .linkType(context.resolve(model.getSymbol()))
                        .text(".") //$NON-NLS-1$
                        .toJavadoc(),
View Full Code Here

Examples of com.bacoder.parser.java.api.ClassDeclaration

  @Override
  public TypeDeclaration adapt(TypeDeclarationContext context) {
    ClassDeclarationContext classDeclarationContext =
        getChild(context, ClassDeclarationContext.class);
    if (classDeclarationContext != null) {
      ClassDeclaration classDeclaration =
          getAdapter(ClassDeclarationAdapter.class).adapt(classDeclarationContext);
      setNodeAttributes(classDeclaration, context);
      setClassOrInterfaceModifiers(context, classDeclaration);
      return classDeclaration;
    }
View Full Code Here

Examples of com.google.dart.engine.ast.ClassDeclaration

      if (element instanceof AngularElement) {
        return element;
      }
    }
    // prepare enclosing ClassDeclaration
    ClassDeclaration classDeclaration = node.getAncestor(ClassDeclaration.class);
    if (classDeclaration == null) {
      return null;
    }
    // prepare ClassElement
    ClassElement classElement = classDeclaration.getElement();
    if (classElement == null) {
      return null;
    }
    // check toolkit objects
    for (ToolkitObjectElement toolkitObject : classElement.getToolkitObjects()) {
View Full Code Here

Examples of com.google.test.metric.cpp.dom.ClassDeclaration

  private final ClassDeclaration node;
  private Visibility currentVisibility;
  private List<String> sts;

  public ClassBuilder(Node parent, String identifier) {
    node = new ClassDeclaration(identifier);
    parent.addChild(node);
    currentVisibility = Visibility.PRIVATE;
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.ClassDeclaration

  }

  public void testProtectedAccessSpecifier() throws Exception {
    TranslationUnit unit = parse(
        "class A { protected: void foo() {} void bar() {} };");
    ClassDeclaration classA = unit.getChild(0);
    FunctionDefinition functionFoo = classA.getChild(0);
    Visibility visibilityFoo = functionFoo.getVisibility();
    assertEquals(Visibility.PROTECTED, visibilityFoo);
    FunctionDefinition functionBar = classA.getChild(1);
    Visibility visibilityBar = functionBar.getVisibility();
    assertEquals(Visibility.PROTECTED, visibilityBar);
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.ClassDeclaration

    assertEquals(64, CPPvariables.QI_TYPE.size());
  }

  public void testInheritance() throws Exception {
    TranslationUnit unit = parse("class A{}; class B : public A {};");
    ClassDeclaration classA = unit.getChild(0);
    ClassDeclaration classB = unit.getChild(1);
    assertEquals("A", classA.getName());
    assertEquals("B", classB.getName());
    ClassDeclaration baseB = classB.getBaseClass(0).getDeclaration();
    assertEquals("A", baseB.getName());
    assertEquals(AccessSpecifier.PUBLIC, classB.getBaseClass(0)
        .getAccessSpecifier());
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.ClassDeclaration

  }

  public void testMultipleInheritence() throws Exception {
    TranslationUnit unit = parse(
        "class A{}; class B{}; class C : public A, protected B {};");
    ClassDeclaration classA = unit.getChild(0);
    ClassDeclaration classB = unit.getChild(1);
    ClassDeclaration classC = unit.getChild(2);
    assertEquals("A", classA.getName());
    assertEquals("B", classB.getName());
    assertEquals("C", classC.getName());

    BaseClass baseC0 = classC.getBaseClass(0);
    BaseClass baseC1 = classC.getBaseClass(1);

    assertEquals("A", baseC0.getDeclaration().getName());
    assertEquals(AccessSpecifier.PUBLIC, baseC0.getAccessSpecifier());

    assertEquals("B", baseC1.getDeclaration().getName());
View Full Code Here

Examples of com.google.test.metric.cpp.dom.ClassDeclaration

  public void testInheritedClassInSpecifiedNamespace() throws Exception {
    TranslationUnit unit = parse(
      "namespace Foo { class A {}; } " +
      "class B : public Foo::A {};");
    Namespace namespaceFoo = unit.getChild(0);
    ClassDeclaration classA = namespaceFoo.getChild(0);
    ClassDeclaration classB = unit.getChild(1);
    assertEquals("Foo::A", classA.getQualifiedName());
    assertEquals("B", classB.getName());
    ClassDeclaration baseB = classB.getBaseClass(0).getDeclaration();
    assertEquals("A", baseB.getName());
    assertEquals(AccessSpecifier.PUBLIC, classB.getBaseClass(0)
        .getAccessSpecifier());
  }
View Full Code Here

Examples of com.google.test.metric.cpp.dom.ClassDeclaration

  }

  public void testInheritedClassInOtherTranslationUnit() throws Exception {
    // Build other tree with external declaration.
    NodeDictionary knownSymbols = new NodeDictionary();
    ClassDeclaration other = new ClassDeclaration("B");
    other.setParent(new Namespace("Bar"));
    knownSymbols.registerNode("Bar::B", other);

    TranslationUnit unit = parse("class A : public Bar::B {};", knownSymbols);
    ClassDeclaration classA = unit.getChild(0);
    assertEquals("A", classA.getName());

    ClassDeclaration baseA = classA.getBaseClass(0).getDeclaration();
    assertEquals("B", baseA.getName());
    assertEquals("Bar::B", baseA.getQualifiedName());
  }
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.