Create a constant element for text parsing

@param constant constant definition
@return pattern element for constant
436992
private PatternConstant create(Constant constant) {
        if (!constants.containsKey(constant)) {
            constants.put(
                    constant,
                    new PatternConstant(constant.getValue(), constant.isIgnoreCase(), constant.isGhost())
            );
        }
        return constants.get(constant);
    }
808324
public static Condition matchText(final String regex) {
    return new Condition("match text") {
      @Override
      public boolean apply(Driver driver, WebElement element) {
        return Html.text.matches(element.getText(), regex);
      }

      @Override
      public String toString() {
        return name + " '" + regex + '\'';
      }
    };
  }
250158
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "reals")
    public JAXBElement<ConstantType> createReals(ConstantType value) {
        return new JAXBElement<ConstantType>(_Reals_QNAME, ConstantType.class, null, value);
    }
1353224
public final int resolveConstantIndex(String constant)
    {
        int size = 0;
        int index = 0;
        int nameIndex = resolveNameIndex(constant);
        constantReadLock.lock();
        try
        {
            size = getConstantPoolSize();
            index = getConstantIndex(constant);
        }
        finally
        {
            constantReadLock.unlock();
        }
        if (index != -1)
        {
            return index;
        }
        return addConstantInfo(new ConstantString(nameIndex), size);
    }
720655
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "naturalnumbers")
    public JAXBElement<ConstantType> createNaturalnumbers(ConstantType value) {
        return new JAXBElement<ConstantType>(_Naturalnumbers_QNAME, ConstantType.class, null, value);
    }
327775
public void ldc(String constant) throws IOException
    {
        int index = subClass.resolveConstantIndex(constant);
        super.ldc(index);
    }
275631
public int find(PatternConstant constant) {
        char[] cs = constant.getCharArray();
        boolean ignoreCase = constant.isIgnoreCase();

        return find(cs, ignoreCase);
    }
141345
public EnumT valueOfStrict(String constant) {
    EnumT value = knownValues.get(constant);
    if (value != null) {
      return value;
    } else {
      throw new IllegalArgumentException(
          "Constant \"" + constant + "\" not found for enum \"" + clazz.getName() + "\"");
    }
  }
534887
public static Pattern compile(String regex, int options) {
        return Pattern.compile(STANDARD.transform(regex), options);
    }
129640
public @NonNull SelectorComponent pattern(final @NonNull String pattern) {
    return new SelectorComponent(this.children, this.color, this.obfuscated, this.bold, this.strikethrough, this.underlined, this.italic, this.clickEvent, this.hoverEvent, this.insertion, requireNonNull(pattern, "pattern"));
  }
1316085
static <V> TextProcessor<V> create(TextElement<V> element) {

        return new TextProcessor<>(
            element, false, Locale.ROOT, TextWidth.WIDE, OutputContext.FORMAT, Leniency.SMART, 0);

    }
813846
public EnumConstant constant(int tag) {
    for (EnumConstant constant : constants()) {
      if (constant.tag() == tag) {
        return constant;
      }
    }
    return null;
  }
1202148
public static SanitizedContent constantAttributes(@CompileTimeConstant final String constant) {
    return fromConstant(constant, ContentKind.ATTRIBUTES, Dir.LTR);
  }
288915
public static <I, O> PredictorTrainer<I, O> constant(O outputValue) {
    return new WrapperTrainer<I, O>(Predictors.<I, O>constant(outputValue));
  }
455321
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "rationals")
    public JAXBElement<ConstantType> createRationals(ConstantType value) {
        return new JAXBElement<ConstantType>(_Rationals_QNAME, ConstantType.class, null, value);
    }
150581
protected static Pattern makePattern (String input)
    {
        StringBuilder pattern = new StringBuilder('^');

        while (true) {
            String[] parts = _splitter.split(input, 2);
            pattern.append(Pattern.quote(parts[0]));
            if (parts.length == 1) {
                break;
            }
            int length = parts[0].length();
            String wildcard = input.substring(length, length + 1);
            if (wildcard.equals("*")) {
                pattern.append(".*");
            } else {
                System.err.println("Bad wildcard " + wildcard);
            }
            input = parts[1];
        }

        pattern.append("$");
        return Pattern.compile(pattern.toString());
    }
1032917
private ProcPattern createPattern(Pattern pattern) {
        if (pattern.isEmpty()) {
            throw new IllegalStateException("Pattern elements list can't be empty.");
        }

        List<ProcPatternElement> elements = new ArrayList<ProcPatternElement>();
        for (PatternElement element : pattern.getElements()) {
            elements.add(patternElementFactory.create(element));
        }
        return new ProcPattern(elements);
    }