Package com.linkedin.data.element

Examples of com.linkedin.data.element.DataElement.path()


    Object value = element.getValue();
    String str = String.valueOf(value);
    int strlen = str.length();
    if ((strlen < _min) || (strlen > _max))
    {
      ctx.addResult(new Message(element.path(), "length of \"%1$s\" is out of range %2$d...%3$d", str, _min, _max));
    }
  }
}
View Full Code Here


    Object value = element.getValue();
    String str = String.valueOf(value);
    boolean matches = _pattern.matcher(str).matches();
    if (! matches)
    {
      ctx.addResult(new Message(element.path(), "\"%1$s\" does not match %2$s", str, _regex));
    }
  }
}
View Full Code Here

    public void validate(ValidatorContext ctx)
    {
      DataElement element = ctx.dataElement();
      if (element.getChild("debug") != null)
      {
        ctx.addResult(new Message(element.path(), false, " = %1$s", element.getValue()));
      }
    }
  }

  // Validator that throws exception in constructor
View Full Code Here

      DataElement element = context.dataElement();
      Object value = element.getValue();
      if (debug) out.println("InstanceOf: value=" + value + "(" + value.getClass().getSimpleName() + ")");
      if (_class.isInstance(value) == false)
      {
        context.addResult(new Message(element.path(), "is not a %1$s", _class.getSimpleName()));
      }
    }
  }

  @Test
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.