All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.isi.nlp.mixins.PatternMixin Maven / Gradle / Ivy

The newest version!
package edu.isi.nlp.mixins;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.regex.Pattern;

/** Fix that Java's regex Pattern is not Jackson-serializable. */
public abstract class PatternMixin {

  @JsonCreator
  public static Pattern compile(
      @JsonProperty("regexString") String regexString, @JsonProperty("flags") int flags) {
    throw new UnsupportedOperationException("Mixin methods are never called!");
  }

  @JsonProperty("regexString")
  public abstract String pattern();

  @JsonProperty("flags")
  public abstract int flags();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy