Package com.caucho.relaxng

Examples of com.caucho.relaxng.RelaxException


   * Adds a name child.
   */
  public void addNameChild(NameClassPattern child)
    throws RelaxException
  {
    throw new RelaxException(L.l("<{0}> is not an allowed child for <{1}>.",
                                 child.getTagName(), getTagName()));
  }
View Full Code Here


   * Adds an element child.
   */
  public void addChild(Pattern child)
    throws RelaxException
  {
    throw new RelaxException(L.l("<{0}> is not an allowed child for <{1}>.",
                                 child.getTagName(), getTagName()));
  }
View Full Code Here

   * Creates the current state
   */
  public Item createItem(GrammarPattern grammar)
    throws RelaxException
  {
    throw new RelaxException(L.l("item isn't allowed in `{0}'.",
                                 getClass().getName()));
  }
View Full Code Here

   * Creates the name program
   */
  public NameClassItem createNameItem()
    throws RelaxException
  {
    throw new RelaxException(L.l("name-item isn't allowed in `{0}'.",
                                 getClass().getName()));
  }
View Full Code Here

  public RelaxException error(String msg)
  {
    String location = getLocation();

    if (location != null)
      return new RelaxException(location + ": " + msg);
    else
      return new RelaxException(msg);
  }
View Full Code Here

      else if (_patterns.get(i).hasElement())
        hasElement = true;
    }

    if (hasData && hasElement)
      throw new RelaxException(L.l("<data> may not be in a <group>.  Use <text> instead."));
  }
View Full Code Here

   */
  public void addChild(Pattern child)
    throws RelaxException
  {
    if (_name == null)
      throw new RelaxException(L.l("<element> must have <name> definitions before other children."));
   
    child.setParent(_children);
    // XXX: (group always null?)
    // child.setElementName(_children.getElementName());

View Full Code Here

   */
  public void endElement()
    throws RelaxException
  {
    if (_name == null)
      throw new RelaxException(L.l("<element> must have a <name> definition."));
   
    if (_children == null)
      throw new RelaxException(L.l("<element> tag '{0}' must have a child grammar production.",
                                   _name.toProduction()));
  }
View Full Code Here

   */
  public void setStart(Pattern start)
    throws RelaxException
  {
    if (_start != null)
      throw new RelaxException(L.l("Duplicate <start> in <grammar>.  The <grammar> element can only have one <start>."));

    _start = start;
  }
View Full Code Here

    throws RelaxException
  {
    if (! (parent instanceof NameClassPattern) &&
        ! (parent instanceof ElementPattern) &&
        ! (parent instanceof AttributePattern)) {
      throw new RelaxException(L.l("{0} is not allowed as a child of {1}",
                                   getTagName(), parent.getTagName()));
    }

    super.setParent(parent);
  }
View Full Code Here

TOP

Related Classes of com.caucho.relaxng.RelaxException

Copyright © 2018 www.massapicom. 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.