net.digitalid.utility.circumfixes.Quotes类的使用及代码示例

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

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

Quotes介绍

[英]This class enumerates various quotation marks.
[中]这门课列举了各种引号。

代码示例

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

@Pure
@Override
public @Nonnull String toString() {
  return Quotes.inSingle(getClass().getSimpleName());
}

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

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

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

@Pure
@Override
public @Nonnull String toString() {
  return "LoggingRule(threshold: " + threshold + ", callerPrefix: " + Quotes.inCode(callerPrefix) + ", threadPrefix: " + Quotes.inCode(threadPrefix) + ", messageRegex: " + Quotes.inCode(messageRegex) + ")";
}

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

/**
 * Returns the given object surrounded by the given quotes.
 */
@Pure
public static @Nonnull String in(@Nullable Quotes quotes, @NonCaptured @Unmodified @Nullable Object object) {
  if (quotes == null) { return String.valueOf(object); }
  else if (quotes == Quotes.CODE) { return object instanceof CharSequence ? "\"" + String.valueOf(object) + "\"" : String.valueOf(object); }
  else { return quotes.getPrefix() + String.valueOf(object) + quotes.getSuffix(); }
}

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

/**
 * Returns the given object in double quotes.
 */
@Pure
public static @Nonnull String inDouble(@Nullable Object object) {
  return in(Quotes.DOUBLE, object);
}

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

/**
 * Returns the given object in double quotes if it is an instance of {@link CharSequence} or without quotes otherwise.
 */
@Pure
public static @Nonnull String inCode(@Nullable Object object) {
  return in(Quotes.CODE, object);
}

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

@Override
public @Nonnull String getAccessCode() {
  throw new UnsupportedOperationException("Non-accessible field " + Quotes.inSingle(getName()) + " does not have an access code.");
}

代码示例来源: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-tuples

/**
 * Returns this tuple as a string without parentheses.
 */
@Pure
public @Nonnull String toStringWithoutParentheses() {
  return Quotes.inCode(element0) + ", " + Quotes.inCode(element1);
}

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

/**
 * Returns the given object in angle quotes.
 */
@Pure
public static @Nonnull String inAngle(@Nullable Object object) {
  return in(Quotes.ANGLE, object);
}

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

/**
 * Returns the configuration field of the declared type in the given annotation value or null if no field fulfilling the criteria is found.
 */
@Pure
protected @Nullable VariableElement getConfigurationField(@Nonnull AnnotationValue annotationValue) {
  final @Nonnull DeclaredType declaredType = (DeclaredType) annotationValue.getValue();
  ProcessingLog.debugging("The declared type is " + Quotes.inSingle(declaredType));
  final @Nonnull TypeElement typeElement = (TypeElement) declaredType.asElement();
  return ProcessingUtility.getFirstPublicStaticFieldOfType(typeElement, Configuration.class);
}

代码示例来源: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-tuples

@Pure
@Override
public @Nonnull String toStringWithoutParentheses() {
  return super.toStringWithoutParentheses() + ", " + Quotes.inCode(element2);
}

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

/**
 * Returns the given object in single quotes.
 */
@Pure
public static @Nonnull String inSingle(@Nullable Object object) {
  return in(Quotes.SINGLE, object);
}

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

/**
 * Adds the provider with the given qualified binary name to the list of providers for the specified service.
 * 
 * @param qualifiedProviderName the name has to be in binary form (i.e. with a dollar sign for inner classes).
 */
@Impure
@NonWrittenRecipient
public void addProvider(@Nonnull String qualifiedProviderName) {
  requireNotWritten();
  
  qualifiedProviderNames.add(qualifiedProviderName);
  ProcessingLog.information("Added the provider " + Quotes.inSingle(qualifiedProviderName) + " for the service " + Quotes.inSingle(service.getName()));
}

代码示例来源: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-tuples

@Pure
@Override
public @Nonnull String toStringWithoutParentheses() {
  return super.toStringWithoutParentheses() + ", " + Quotes.inCode(element3);
}

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

while (stringIndex < string.length() && argumentIndex < arguments.length) {
  if (string.charAt(stringIndex) == symbol) {
    final @Nonnull String argument = Quotes.in(quotes, arguments[argumentIndex]);
    string.replace(stringIndex, stringIndex + 1, argument);
    stringIndex += argument.length();
  while (argumentIndex < arguments.length) {
    if (first) { first = false; } else { string.append(", "); }
    string.append(Quotes.in(quotes, arguments[argumentIndex]));
    argumentIndex++;

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

@Pure
@Override
public @Nonnull String visitChar(char value, @NonCaptured @Modified @Nullable TypeImporter typeImporter) {
  return Quotes.inSingle(String.valueOf(value));
}

代码示例来源: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(", ", "", "") + ")");
  }
}

相关文章