Returns a new builder for {@link Description}s.

@param node the node where the error is
@param checker the {@code BugChecker} instance that is producing this {@code Description}
161501
@CheckReturnValue
  public static Description.Builder buildDescriptionFromChecker(Tree node, BugChecker checker) {
    return Description.builder(
        Preconditions.checkNotNull(node),
        checker.canonicalName(),
        checker.linkUrl(),
        checker.defaultSeverity(),
        checker.message());
  }
1172123
private ClassBuilder getClassBuilder(Element element) {
        ClassBuilder classBuilder = new ClassBuilder(messager, element);
        classBuilder.setBindingManager(this);
        return classBuilder;
    }
848679
@SuppressWarnings("unchecked")
  public static <ObsT, SummaryT> Builder<ObsT, SummaryT> forSummarizer(
      final ObservationSummarizer<? super ObsT, ? extends SummaryT> observationSummarizer,
      int numSamples,
      final Random rng) {
    return new Builder<ObsT, SummaryT>(
        (ObservationSummarizer<ObsT, SummaryT>) observationSummarizer, numSamples, rng);
  }
837018
@Nonnull
	public static <T> LObjCharConsumer<T> objCharConsumerFrom(Consumer<LObjCharConsumerBuilder<T>> buildingFunction) {
		LObjCharConsumerBuilder builder = new LObjCharConsumerBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
393179
@Nonnull
	public static <T1, T2> LBiObjCharConsumer<T1, T2> biObjCharConsumerFrom(Consumer<LBiObjCharConsumerBuilder<T1, T2>> buildingFunction) {
		LBiObjCharConsumerBuilder builder = new LBiObjCharConsumerBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
838644
@Nonnull
	public static <T> LObjIntCharPredicate<T> objIntCharPredicateFrom(Consumer<LObjIntCharPredicateBuilder<T>> buildingFunction) {
		LObjIntCharPredicateBuilder builder = new LObjIntCharPredicateBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
1044767
public DTMIterator createDTMIterator(int node)
  {
    // DescendantIterator iter = new DescendantIterator();
    DTMIterator iter = new org.apache.xpath.axes.OneStepIteratorForward(Axis.SELF);
    iter.setRoot(node, this);
    return iter;
    // return m_dtmManager.createDTMIterator(node);
  }
1283893
private String createXML(NodeConfig node) {
		class XMLCreator extends XmlMarshaller {
			public XMLCreator(NodeConfig node) {
				super(node);
			}

			public String print() {
				try {
					return super.marshal().toString();
				} catch (MarshalException e) {
					return "";
				}
			}
		}
		XMLCreator creator = new XMLCreator(node);
		return creator.print();
	}
898350
public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
    {
        if(isValidating()) {
            try {
                return new ValidatingDocumentBuilder(
                    _WrappedFactory.newDocumentBuilder(),
                    _Schema.newVerifier());
            } catch(VerifierConfigurationException ex) {
                throw new ParserConfigurationException(ex.getMessage());
            }
        } else
            //if validation is disabled, we simply return the implementation of wrapped DocumentBuilder
            return _WrappedFactory.newDocumentBuilder();
    }
459513
public static Builder builder(
      DiagnosticPosition position,
      String name,
      @Nullable String link,
      SeverityLevel severity,
      String message) {
    return new Builder(position, name, link, severity, message);
  }
594863
protected void isElementWellFormed(Node node) {
        boolean isNameWF = false;
        if ((fFeatures & NAMESPACES) != 0) {
            isNameWF =
                isValidQName(
                    node.getPrefix(),
                    node.getLocalName(),
                    fIsXMLVersion11);
        } else {
            isNameWF = isXMLName(node.getNodeName(), fIsXMLVersion11);
        }

        if (!isNameWF) {
            String msg =
                Utils.messages.createMessage(
                    MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
                    new Object[] { "Element", node.getNodeName()});

            if (fErrorHandler != null) {
                fErrorHandler.handleError(
                    new DOMErrorImpl(
                        DOMError.SEVERITY_FATAL_ERROR,
                        msg,
                        MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
                        null,
                        null,
                        null));
            }
        }
    }
247792
private static void extractFromReturnDescendant(Builder builder, Node node)
      throws MalformedException {

    switch (node.getToken()) {
      case STRING:
        builder.appendStringPart(node.getString());
        break;
      case NAME:
        builder.appendPlaceholderReference(node.getString());
        break;
      case ADD:
        for (Node child : node.children()) {
          extractFromReturnDescendant(builder, child);
        }
        break;
      default:
        throw new MalformedException(
            "STRING, NAME, or ADD node expected; found: " + node.getToken(), node);
    }
  }
318403
@Nonnull
	public static LBoolToIntFunction boolToIntFunctionFrom(Consumer<LBoolToIntFunctionBuilder> buildingFunction) {
		LBoolToIntFunctionBuilder builder = new LBoolToIntFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
144470
public static Builder newParserConfigBuilder() {
        return new Builder() {
            boolean used = false;
            CollectionBuilder.Factory listFactory = DEFAULT_LIST_FACTORY;
            CollectionBuilder.Factory vectorFactory = DEFAULT_VECTOR_FACTORY;
            CollectionBuilder.Factory setFactory = DEFAULT_SET_FACTORY;
            CollectionBuilder.Factory mapFactory = DEFAULT_MAP_FACTORY;
            Map<Tag, TagHandler> tagHandlers = defaultTagHandlers();

            public Builder setListFactory(CollectionBuilder.Factory listFactory) {
                checkState();
                this.listFactory = listFactory;
                return this;
            }

            public Builder setVectorFactory(CollectionBuilder.Factory vectorFactory) {
                checkState();
                this.vectorFactory = vectorFactory;
                return this;
            }

            public Builder setSetFactory(CollectionBuilder.Factory setFactory) {
                checkState();
                this.setFactory = setFactory;
                return this;
            }

            public Builder setMapFactory(CollectionBuilder.Factory mapFactory) {
                checkState();
                this.mapFactory = mapFactory;
                return this;
            }

            public Builder putTagHandler(Tag tag, TagHandler handler) {
                checkState();
                this.tagHandlers.put(tag, handler);
                return this;
            }

            public Config build() {
                checkState();
                used = true;
                return new Config() {
                    public Factory getListFactory() {
                        return listFactory;
                    }

                    public Factory getVectorFactory() {
                        return vectorFactory;
                    }

                    public Factory getSetFactory() {
                        return setFactory;
                    }

                    public Factory getMapFactory() {
                        return mapFactory;
                    }

                    public TagHandler getTagHandler(Tag tag) {
                        return tagHandlers.get(tag);
                    }
                };
            }

            private void checkState() {
                if (used) {
                    throw new IllegalStateException(
                            "Builder is single-use. Not usable after build()");
                }
            }
        };
    }
764542
final void checkConformance(Node node, ErrorReporter errorReporter) {
    if (nodeClass.isAssignableFrom(node.getClass())) {
      doCheckConformance(nodeClass.cast(node), errorReporter);
    }
  }
257593
public static Matcher newClass() {
    return new Matcher() {
      @Override public boolean matches(Node node, NodeMetadata metadata) {
        return node.isNew();
      }
    };
  }
1172136
public static ScannerSupplier fromBugCheckerClasses(
      Iterable<Class<? extends BugChecker>> checkers) {
    ImmutableList.Builder<BugCheckerInfo> builder = ImmutableList.builder();
    for (Class<? extends BugChecker> checker : checkers) {
      builder.add(BugCheckerInfo.create(checker));
    }
    return fromBugCheckerInfos(builder.build());
  }