net.digitalid.utility.circumfixes.Quotes.inDouble()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中net.digitalid.utility.circumfixes.Quotes.inDouble方法的一些代码示例,展示了Quotes.inDouble的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quotes.inDouble方法的具体详情如下:
包路径:net.digitalid.utility.circumfixes.Quotes
类名称:Quotes
方法名:inDouble

Quotes.inDouble介绍

[英]Returns the given object in double quotes.
[中]以双引号返回给定对象。

代码示例

代码示例来源:origin: net.digitalid.utility/utility-processor

@Pure
@Override
public @Nonnull String toString() {
  return "FileGenerator(name: " + Quotes.inDouble(getName()) + ")";
}

代码示例来源:origin: net.digitalid.utility/utility-processing

@Pure
@Override 
public @Nonnull String visitString(@Nonnull String string, @NonCaptured @Modified @Nullable TypeImporter typeImporter) {
  return Quotes.inDouble(string.replaceAll("\"", "\\\\\""));
}

代码示例来源:origin: net.digitalid.utility/utility-validation

@Pure
@Override
public void checkUsage(@Nonnull Element element, @Nonnull AnnotationMirror annotationMirror, @NonCaptured @Modified @Nonnull ErrorLogger errorLogger) {
  final @Nonnull String suffix = getSuffix(annotationMirror);
  final @Nonnull TypeMirror elementType = ProcessingUtility.getType(element);
  final @Nonnull Element enclosingElement = element.getEnclosingElement();
  final boolean inConstructor = enclosingElement.getKind() == ElementKind.CONSTRUCTOR;
  if (hasMethodToCheckValidity((DeclaredType) ProcessingUtility.getSurroundingType(element).asType(), elementType, inConstructor, suffix)) { return; }
  if (enclosingElement.getKind() == ElementKind.METHOD) {
    @Nonnull TypeMirror typeOfFirstParameter = ((ExecutableElement) enclosingElement).getParameters().get(0).asType();
    if (typeOfFirstParameter.getKind() == TypeKind.TYPEVAR) { typeOfFirstParameter = ((TypeVariable) typeOfFirstParameter).getUpperBound(); }
    if (typeOfFirstParameter.getKind() == TypeKind.DECLARED && hasMethodToCheckValidity((DeclaredType) typeOfFirstParameter, elementType, false, suffix)) { return; }
  }
  final @Nonnull String annotationValue = suffix.isEmpty() ? "" : Brackets.inRound(Quotes.inDouble(suffix));
  if (inConstructor) { errorLogger.log("The annotation '@Valid" + annotationValue + "' may only be used on constructor parameters of types that have a 'public static boolean isValid" + suffix + "(value)' method for the corresponding type.", SourcePosition.of(element, annotationMirror)); }
  else { errorLogger.log("The annotation '@Valid" + annotationValue + "' may only be used in types that have a corresponding non-private '(static) boolean isValid" + suffix + "(value)' method or on method parameters where the first method parameter has such a method.", SourcePosition.of(element, annotationMirror)); }
}

代码示例来源:origin: net.digitalid.utility/utility-processor

@Impure
@NonWrittenRecipient
@OnlyPossibleIn()
protected void addContract(@Nonnull Class<? extends Constraint> contractType, @Nullable Contract generatedContract) {
  if (generatedContract != null) {
    addStatement(importIfPossible(contractType) + ".that(" + generatedContract.getCondition() + ").orThrow(" + Quotes.inDouble(generatedContract.getMessage()) + generatedContract.getArguments().join(", ", "", "") + ")");
  }
}

代码示例来源:origin: net.digitalid.utility/utility-generator

final @Nonnull String nameOfVariable = annotationValuesMap + Strings.capitalizeFirstLetters(entry.getKey()) + "Classes";
          statements.add("Class[] " + nameOfVariable + " = " + printValue);
          statements.add(annotationValuesMap + ".put" + Brackets.inRound(Quotes.inDouble(entry.getKey()) + ", " + nameOfVariable));
        } else {
          statements.add(annotationValuesMap + ".put" + Brackets.inRound(Quotes.inDouble(entry.getKey()) + ", " + printValue));
  fieldsString.append(", ");
fieldsString.append(importIfPossible(CustomField.class)).append(".with(").append(CustomType.getTypeName(representingField.getType(), representingField.getAnnotations(), this)).append(", ").append(Quotes.inDouble(fieldName)).append(", ImmutableList." + Brackets.inPointy(importIfPossible(CustomAnnotation.class)) + "withElements(").append(customAnnotations.toString()).append("))");

代码示例来源:origin: net.digitalid.utility/utility-generator

@Impure
private void generateGetTypePackage() {
  addAnnotation(Pure.class);
  addAnnotation(Override.class);
  beginMethod("public @" + importIfPossible(Nonnull.class) + " " + importIfPossible(String.class) + " getTypePackage()");
  addStatement("return " + Quotes.inDouble(typeInformation.getQualifiedPackageName()));
  endMethod();
}

代码示例来源:origin: net.digitalid.utility/utility-generator

@Impure
private void generateGetTypeName() {
  addAnnotation(Pure.class);
  addAnnotation(Override.class);
  beginMethod("public @" + importIfPossible(Nonnull.class) + " " + importIfPossible(String.class) + " getTypeName()");
  addStatement("return " + Quotes.inDouble(typeInformation.getName()));
  endMethod();
}

相关文章