Пример #1
0
  public DataTypeDetectionStrategy getDataTypeDetectionStrategy() {
    String dataTypeDetection = this.config.getString("[@datatype-detection]", null);

    if (dataTypeDetection != null) {
      try {
        return DataTypeDetectionStrategy.valueOf(dataTypeDetection);
      } catch (IllegalArgumentException e) {
        // fall through...
      }
    }

    if (this.defaultDataTypeDetectionStrategy != null) {
      return this.defaultDataTypeDetectionStrategy;
    }

    if (this.enunciate.getIncludePatterns().isEmpty()) {
      // if there are no configured include patterns, then we'll just stick with "local" detection
      // so we don't include too much.
      return DataTypeDetectionStrategy.local;
    } else {
      // otherwise, we'll assume the user knows what (s)he's doing and aggressively include
      // everything.
      return DataTypeDetectionStrategy.aggressive;
    }
  }
Пример #2
0
  public DataTypeDetectionStrategy getDataTypeDetectionStrategy() {
    String dataTypeDetection = this.config.getString("[@datatype-detection]", null);

    if (dataTypeDetection != null) {
      try {
        return DataTypeDetectionStrategy.valueOf(dataTypeDetection);
      } catch (IllegalArgumentException e) {
        // fall through...
      }
    }

    return this.defaultDataTypeDetectionStrategy == null
        ? DataTypeDetectionStrategy.local
        : this.defaultDataTypeDetectionStrategy;
  }