Package net.ftlines.metagen.processor.model

Examples of net.ftlines.metagen.processor.model.QualifiedName


    while (element.getNestingKind() != NestingKind.TOP_LEVEL)
    {
      element = (TypeElement)element.getEnclosingElement();
      cn = element.getSimpleName() + MARKER + "." + cn;
    }
    cn = new QualifiedName(element.getQualifiedName().toString()).getNamespace() + "." + cn;

    return new QualifiedName(cn);
  }
View Full Code Here


      cn = (source.getSimpleName() + Constants.MARKER) + "$" + cn;
    }

    cn = source.getPackage().getName() + "." + cn;

    return new QualifiedName(cn);
  }
View Full Code Here

    writer.line("%s static final String simpleName=\"%s\";", node.getVisibility().getKeyword(), node.getName()
      .getLocal());
    writer.endClass();

    writer.line();
    Optional<QualifiedName> scn = Optional.of(node.getSuperclass().isSet() ? new QualifiedName(
      Constants.getMetaClassName(node.getSuperclass().get().getElement()).getQualified() + ".P") : null);
    writer.startNestedClass(node.getVisibility(), "P", scn);
    for (Property property : properties.peek())
    {
      writer.line("%s static final String %s=\"%s\";", property.getVisibility().getKeyword(),
View Full Code Here

    }
  }

  public QualifiedName getName()
  {
    return new QualifiedName(element);
  }
View Full Code Here

  {
    TypeElement element = node.getElement();
    //env.getFiler().getResource(StandardLocation.SOURCE_OUTPUT, element., arg2)
    try
    {
      QualifiedName name = Constants.getMetaClassName(node.getElement());

      logger.log("Generating source file for: %s", name.getQualified());
      logger.log("   Found: %d inner beans", node.getNestedBeans().size());

      JavaFileObject source = env.getFiler().createSourceFile(name.getQualified(), node.getElement());
     
      writer = new SourceWriter(source.openOutputStream());

      writer.header(node.getName().getNamespace());
      writer.line();

      Optional<QualifiedName> scn = Optional.of(node.getSuperclass().isSet()
        ? Constants.getMetaClassName(node.getSuperclass().get().getElement()) : null);

      writer.startClass(Visibility.PUBLIC, name.getLocal(), scn);

      logger.log("    Writing out top level class: %s", name.getLocal());
     
      afterEnterBean(node);
      return true;
    }
    catch (IOException e)
View Full Code Here

  @Override
  public void enterNestedBean(NestedBean node)
  {
    try
    {
      QualifiedName name = Constants.getMetaClassName(node.getElement());
      Optional<QualifiedName> scn = Optional.of(node.getSuperclass().isSet()
        ? Constants.getMetaClassName(node.getSuperclass().get().getElement()) : null);

      writer.startNestedClass(Visibility.PUBLIC, name.getLocal(), scn);

      logger.log("    Writing out inner class: %s", name.getLocal());
     
      afterEnterBean(node);
    }
    catch (IOException e)
    {
View Full Code Here

    Element element = node.getAccessor();

    String type = node.getType().accept(new TypeResolver(), null);
    Visibility visibility = node.getVisibility();
    QualifiedName containerName = new QualifiedName(node.getContainer());
    try
    {
      int hasGetter = 0;
      if (node.getGetter() != null)
      {
        if (node.getGetter().getSimpleName().toString().startsWith("get"))
        {
          hasGetter = 1;
        }
        else
        {
          hasGetter = 2;
        }
      }
      String setterName = name(node.getSetter());
      String getterName = name(node.getGetter());
      String fieldName = name(node.getField());
      if (node.isDeprecated())
      {
        writer.line("@Deprecated");
      }
      writer.line("%s static final %s<%s,%s> %s = new %s(\"%s\", %s.class, %s, %s, %s);",
        visibility.getKeyword(), Constants.SINGULAR, containerName.getQualified(), type, node.getHandle(),
        Constants.SINGULAR, node.getName(), beans.peek().getName().getQualified(), fieldName, getterName,
        setterName);
    }
    catch (IOException e)
    {
View Full Code Here

TOP

Related Classes of net.ftlines.metagen.processor.model.QualifiedName

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.