Construct a new ClassBuilder.

@param context           the build context.
@param annotationTypeDoc the class being documented.
@param writer            the doclet specific writer.
482762
public static AnnotationTypeBuilder getInstance(Context context,
            AnnotationTypeDoc annotationTypeDoc,
            AnnotationTypeWriter writer)
            throws Exception {
        return new AnnotationTypeBuilder(context, annotationTypeDoc, writer);
    }
3598
protected void makeAnnotationTypeElementDoc(MethodSymbol meth, TreePath treePath) {
        AnnotationTypeElementDocImpl result =
            (AnnotationTypeElementDocImpl)methodMap.get(meth);
        if (result != null) {
            if (treePath != null) result.setTreePath(treePath);
        } else {
            result =
                new AnnotationTypeElementDocImpl(this, meth, treePath);
            methodMap.put(meth, result);
        }
    }
273404
private static <T extends Annotation> FieldWriter annotationFieldWriter(
      final String name, final AnnotationRef<T> ref) {
    return new FieldWriter() {
      @Override
      public void write(AnnotationVisitor visitor, Object value) {
        ref.doWrite(ref.annType.cast(value), visitor.visitAnnotation(name, ref.typeDescriptor));
      }
    };
  }
667178
public AbstractBuilder getAnnotationTypeOptionalMemberBuilder(
            AnnotationTypeWriter annotationTypeWriter)
    throws Exception {
        return AnnotationTypeOptionalMemberBuilder.getInstance(context,
            annotationTypeWriter.getAnnotationTypeDoc(),
            writerFactory.getAnnotationTypeOptionalMemberWriter(
                annotationTypeWriter));
    }
821320
public AbstractBuilder getPropertyBuilder(ClassWriter classWriter) throws Exception {
        final PropertyWriter propertyWriter =
                writerFactory.getPropertyWriter(classWriter);
        return PropertyBuilder.getInstance(context,
                                           classWriter.getClassDoc(),
                                           propertyWriter);
    }
255551
public void buildClassDoc(XMLNode node, Content contentTree) throws Exception {
         String key;
         if (isInterface) {
             key =  "doclet.Interface";
         } else if (isEnum) {
             key = "doclet.Enum";
         } else {
             key =  "doclet.Class";
         }
         contentTree = writer.getHeader(configuration.getText(key) + " " +
                 classDoc.name());
         Content classContentTree = writer.getClassContentHeader();
         buildChildren(node, classContentTree);
         writer.addClassContentTree(contentTree, classContentTree);
         writer.addFooter(contentTree);
         writer.printDocument(contentTree);
         writer.close();
         copyDocFiles();
     }
1331629
public AnnotatedTypeBuilder<X> addToMethod(AnnotatedMethod<? super X> method, Annotation annotation) {
       return addToMethod(method.getJavaMember(), annotation);
   }
983206
public AbstractBuilder getMethodBuilder(ClassWriter classWriter)
           throws Exception {
        return MethodBuilder.getInstance(context,
            classWriter.getClassDoc(),
            writerFactory.getMethodWriter(classWriter));
    }
755466
@Override
    public <T> RegistrationAnnotatedBindingBuilder<T> register(Class<T> type) {
        return new RegistrationBindingBuilderImpl<>(binder, type);
    }
332574
public AbstractBuilder getAnnotationTypeRequiredMemberBuilder(
            AnnotationTypeWriter annotationTypeWriter) {
        return AnnotationTypeRequiredMemberBuilder.getInstance(context,
            annotationTypeWriter.getAnnotationTypeElement(),
            writerFactory.getAnnotationTypeRequiredMemberWriter(annotationTypeWriter));
    }
1198422
public static AnnotationTypeOptionalMemberBuilder getInstance(
            Context context, TypeElement typeElement,
            AnnotationTypeOptionalMemberWriter writer) {
        return new AnnotationTypeOptionalMemberBuilder(context,
                typeElement, writer);
    }
305311
static void initBuilder() {
		try {
			DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
			docBuilderFactory.setNamespaceAware(true);
			docBuilder = docBuilderFactory.newDocumentBuilder();
		} catch (ParserConfigurationException ex) {
			throw new RuntimeException(ex);
		}
	}
1357659
public AnnotatedTypeBuilder<X> addToMethod(Method method, Annotation annotation) {
       if (methods.get(method) == null) {
           methods.put(method, new AnnotationBuilder());
       }
       methods.get(method).add(annotation);
       return this;
   }
456078
protected function compileMethodDefinitions(ClassBuilder $builder, StreamWriter $writer)
    {

        foreach ($builder->getMethods() as $method) {
            /* @var MethodBuilder $method */

            $writer->indent()->writeLine('/**');

            $comments = $method->getComments();
            if (count($comments)) {
                foreach ($comments as $comment) {
                    $comment = trim(ltrim($comment, '>'));
                    $writer->indent()->write(' * ')->writeLine($comment);
                }
                $writer->indent()->write(' * ')->writeLine();
            }

            $arguments = $method->getArguments();
            $argumentTypeMaxLen = 0;
            if (count($arguments)) {
                foreach ($arguments as $argument) {
                    $argumentTypeMaxLen = max($argumentTypeMaxLen, strlen($argument[1]));
                }
            }

            foreach ($arguments as $argument) {
                $writer->indent()
                    ->write(' * @param ' . sprintf('%-' . $argumentTypeMaxLen . 's', $argument[1]))
                    ->writeLine(' $' . $argument[0]);
            }

            if ($method->getType()) {
                $writer->indent()->writeLine(' *');
                $writer->indent()->writeLine(' * @return ' . $method->getType());
            }

            $writer->indent()->writeLine(' */');

            $writer->indent()
                ->write($method->getVisibility())
                ->write(' function ')
                ->write($method->getName())
                ->write('(');

            $args = array();
            foreach ($arguments as $argument) {
                $type = $this->getType($argument[1]);
                $item = '';
                if ($type['hint']) {
                    $item .= $type['name'] . ' ';
                }
                $item .= '$'.$argument[0];
                $args[] = $item;
            }

            if (count($args)) {
                $writer->write(implode(', ', $args));
            }

            $writer->writeLine(')')
                ->indent()->writeLine('{')
                ->indent()->indent()->writeLine()
                ->indent()->writeLine('}')->writeLine();
        }
    }
767151
public AnnotatedTypeBuilder<X> addToField(Field field, Annotation annotation) {
       if (fields.get(field) == null) {
           fields.put(field, new AnnotationBuilder());
       }
       fields.get(field).add(annotation);
       return this;
   }
1138863
public static void generate(ConfigurationImpl configuration,
                                ClassUseMapper mapper, ClassDoc classdoc) {
        ClassUseWriter clsgen;
        DocPath path = DocPath.forPackage(classdoc)
                .resolve(DocPaths.CLASS_USE)
                .resolve(DocPath.forName(classdoc));
        try {
            clsgen = new ClassUseWriter(configuration,
                                        mapper, path,
                                        classdoc);
            clsgen.generateClassUseFile();
            clsgen.close();
        } catch (IOException exc) {
            configuration.standardmessage.
                error("doclet.exception_encountered",
                      exc.toString(), path.getPath());
            throw new DocletAbortException(exc);
        }
    }
171611
public void writeBindingContext(SourceWriter writer, Context context) {
    // Avoid a trailing \n -- the GWT class source file composer will output an
    // ugly extra newline if we do that.
    String text = context.toString();
    boolean first = true;
    for (String line : text.split("\n")) {
      if (first) {
        first = false;
      } else {
        writer.println();
      }
      // Indent the line relative to its current location.  writer.indent()
      // won't work, since it does the wrong thing in Javadoc.
      writer.print("  ");
      writer.print(line);
    }
  }