Пример #1
0
  public static void checkValidCommentText(String text) {
    if (text == null) throw new NullPointerException("Text cannot be null");

    if (!XmlGrammar.xmlCommentText().matcher(text).matches())
      throw new IllegalArgumentException("Not a valid XML Comment text");
  }
Пример #2
0
  public static void checkValidXmlName(String name) {
    if (name == null) throw new NullPointerException("Name cannot be null");

    if (!XmlGrammar.xmlName().matcher(name).matches())
      throw new IllegalArgumentException("Not a valid XML Name");
  }