Example #1
0
  @Override
  public final ForcedType getConfiguredForcedType(
      Definition definition, DataTypeDefinition definedType) {
    for (ForcedType forcedType : getConfiguredForcedTypes()) {
      String expression = forcedType.getExpression();

      if (forcedType.getExpressions() != null) {
        expression = forcedType.getExpressions();
        log.warn(
            "DEPRECATED",
            "The <expressions/> element in <forcedType/> is deprecated. Use <expression/> instead");
      }

      String types = forcedType.getTypes();
      boolean match = true;

      if (expression != null && !definition.getQualifiedName().matches(expression)) {
        match = false;
      }

      if (types != null && definedType != null && !definedType.getType().matches(types)) {
        match = false;
      }

      if (match) {
        return forcedType;
      }
    }

    return null;
  }
Example #2
0
  @Override
  public final ForcedType getConfiguredForcedType(Definition definition) {
    for (ForcedType forcedType : getConfiguredForcedTypes()) {
      if (definition.getQualifiedName().matches(forcedType.getExpressions())) {
        return forcedType;
      }
    }

    return null;
  }