org.bson.BSON.regexFlags()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(199)

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

BSON.regexFlags介绍

[英]Converts Java regular expression flags into regular expression modifiers from the database.
[中]

代码示例

代码示例来源:origin: spring-projects/spring-data-mongodb

private Pattern toPattern(String regex, @Nullable String options) {
  Assert.notNull(regex, "Regex string must not be null!");
  return Pattern.compile(regex, options == null ? 0 : BSON.regexFlags(options));
}

代码示例来源:origin: org.mongodb/mongo-java-driver

@Override
public void gotRegex(final String name, final String pattern, final String flags) {
  _put(name, Pattern.compile(pattern, BSON.regexFlags(flags)));
}

代码示例来源:origin: org.mongodb/mongo-java-driver

/**
 * Encodes a Pattern field to a {@link org.bson.BsonType#REGULAR_EXPRESSION}.
 *
 * @param name  the field name
 * @param value the value
 * @mongodb.driver.manual reference/operator/query/regex/ $regex
 * @see org.bson.BsonType#BINARY
 */
protected void putPattern(final String name, final Pattern value) {
  putName(name);
  bsonWriter.writeRegularExpression(new BsonRegularExpression(value.pattern(), org.bson.BSON.regexFlags(value.flags())));
}

代码示例来源:origin: org.mongodb/mongo-java-driver

org.bson.BSON.regexFlags((String) b.get("$options")));
} else if (b.containsField("$ts")) { //Legacy timestamp format
  Integer ts = ((Number) b.get("$ts")).intValue();

代码示例来源:origin: org.springframework.data/spring-data-mongodb

private Pattern toPattern(String regex, @Nullable String options) {
  Assert.notNull(regex, "Regex string must not be null!");
  return Pattern.compile(regex, options == null ? 0 : BSON.regexFlags(options));
}

代码示例来源:origin: org.mongodb/mongo-java-driver

return Pattern.compile(
             regularExpression.getPattern(),
             BSON.regexFlags(regularExpression.getOptions())
             );
case DB_POINTER:

代码示例来源:origin: com.sequoiadb/sequoiadb-driver

public void gotRegex(String name, String pattern, String flags) {
  _put(name, Pattern.compile(pattern, BSON.regexFlags(flags)));
}

代码示例来源:origin: com.sequoiadb/sequoiadb-driver

private void putPattern(String name, Pattern p) {
  _put(REGEX, name);
  _put(p.pattern());
  _put(regexFlags(p.flags()));
}

代码示例来源:origin: Aresyi/smart-api

private void putPattern(String name, Pattern p) {
  this._put(11, name);
  this._buf.writeCString(p.pattern());
  this._buf.writeCString(BSON.regexFlags(p.flags()));
}

代码示例来源:origin: com.sequoiadb/sequoiadb-driver

public void serialize(Object obj, StringBuilder buf) {
    BSONObject externalForm = new BasicBSONObject();
    externalForm.put("$regex", obj.toString());
    if (((Pattern) obj).flags() != 0) externalForm.put("$options", BSON.regexFlags(((Pattern) obj).flags()));
    serializer.serialize(externalForm, buf);
  }
}

代码示例来源:origin: org.mongodb/mongodb-driver

org.bson.BSON.regexFlags((String) b.get("$options")));
} else if (b.containsField("$ts")) { //Legacy timestamp format
  Integer ts = ((Number) b.get("$ts")).intValue();

代码示例来源:origin: com.sequoiadb/sequoiadb-driver

BSON.regexFlags((String) b.get("$options")));
if (!isStackEmpty()) {
  cur().put(name, o);

代码示例来源:origin: fr.opensagres.mongodb/mongo-jee

BSON.regexFlags( (String)b.get( "$options" )) );
if (!isStackEmpty()) {
  cur().put( name, o );

相关文章