Package org.apache.wicket.markup

Examples of org.apache.wicket.markup.WicketParseException


      // the child attribute of the open tag if required
      else if (tag.isClose())
      {
        if (stack == null)
        {
          throw new WicketParseException("Missing open tag for Enclosure:", tag);
        }

        // Remove the open tag from the stack
        ComponentTag lastEnclosure = stack.pop();

        // If the child attribute has not been given by the user,
        // then ...
        if (childId != null)
        {
          lastEnclosure.put(CHILD_ATTRIBUTE, childId);
          lastEnclosure.setModified(true);
          childId = null;
        }

        if (stack.size() == 0)
        {
          stack = null;
        }
      }
      else
      {
        throw new WicketParseException("Open-close tag not allowed for Enclosure:", tag);
      }
    }
    // Are we inside a wicket:enclosure tag?
    else if (stack != null)
    {
      ComponentTag lastEnclosure = stack.getLast();

      // If the enclosure tag has NO child attribute, then ...
      if (lastEnclosure.getAttribute(CHILD_ATTRIBUTE) == null)
      {
        String id = tag.getAttribute(getWicketNamespace() + ":id");
        if (id != null)
        {
          // We encountered more than one child component inside
          // the enclosure and are not able to automatically
          // determine the child component to delegate the
          // isVisible() to => Exception
          if (childId != null)
          {
            throw new WicketParseException("Use <" + getWicketNamespace() +
              ":enclosure child='xxx'> to name the child component:", tag);
          }
          // Remember the child id. The open tag will be updated
          // once the close tag is found. See above.
          childId = id;
View Full Code Here


      // If the tag is not a well-known wicket namespace tag
      if (!isWellKnown(tag))
      {
        // give up
        throw new WicketParseException("Unknown tag name with Wicket namespace: '" +
          tag.getName() + "'. Might be you haven't installed the appropriate resolver?",
          tag);
      }
    }

    if (wicketIdValue != null)
    {
      if (wicketIdValue.trim().length() == 0)
      {
        throw new WicketParseException(
          "The wicket:id attribute value must not be empty. May be unmatched quotes?!?",
          tag);
      }
      // Make it a wicket component. Otherwise it would be RawMarkup
      tag.setId(wicketIdValue);
View Full Code Here

      // If the tag is not a well-known wicket namespace tag
      if (!isWellKnown(tag))
      {
        // give up
        throw new WicketParseException("Unknown tag name with Wicket namespace: '" +
          tag.getName() + "'. Might be you haven't installed the appropriate resolver?",
          tag);
      }
    }

    if (wicketIdValue != null)
    {
      if (wicketIdValue.trim().length() == 0)
      {
        throw new WicketParseException(
          "The wicket:id attribute value must not be empty. May be unmatched quotes?!?",
          tag);
      }
      // Make it a wicket component. Otherwise it would be RawMarkup
      tag.setId(wicketIdValue);
View Full Code Here

      // If the tag is not a well-known wicket namespace tag
      if (!isWellKnown(tag))
      {
        // give up
        throw new WicketParseException("Unknown tag name with Wicket namespace: '" +
          tag.getName() + "'. Might be you haven't installed the appropriate resolver?",
          tag);
      }
    }

    if (wicketIdValue != null)
    {
      if (wicketIdValue.trim().length() == 0)
      {
        throw new WicketParseException(
          "The wicket:id attribute value must not be empty. May be unmatched quotes?!?",
          tag);
      }
      // Make it a wicket component. Otherwise it would be RawMarkup
      tag.setId(wicketIdValue);
View Full Code Here

      // the child attribute of the open tag if required
      else if (tag.isClose())
      {
        if (stack == null)
        {
          throw new WicketParseException("Missing open tag for Enclosure:", tag);
        }

        // Remove the open tag from the stack
        ComponentTag lastEnclosure = stack.pop();

        // If the child attribute has not been given by the user,
        // then ...
        if (childId != null)
        {
          lastEnclosure.put(CHILD_ATTRIBUTE, childId);
          lastEnclosure.setModified(true);
          childId = null;
        }

        if (stack.size() == 0)
        {
          stack = null;
        }
      }
      else
      {
        throw new WicketParseException("Open-close tag not allowed for Enclosure:", tag);
      }
    }
    // Are we inside a wicket:enclosure tag?
    else if ((tag.getId() != null) && (isWicketTag == false) && (stack != null))
    {
      ComponentTag lastEnclosure = stack.lastElement();

      // If the enclosure tag has NO child attribute, then ...
      if (lastEnclosure.getAttribute(CHILD_ATTRIBUTE) == null)
      {
        // We encountered more than one child component inside
        // the enclosure and are not able to automatically
        // determine the child component to delegate the
        // isVisible() to => Exception
        if (childId != null)
        {
          throw new WicketParseException(
            "Use <wicket:enclosure child='xxx'> to name the child component:", tag);
        }
        // Remember the child id. The open tag will be updated
        // once the close tag is found. See above.
        childId = tag.getId();
View Full Code Here

      // the child attribute of the open tag if required
      else if (tag.isClose())
      {
        if (stack == null)
        {
          throw new WicketParseException("Missing open tag for Enclosure:", tag);
        }

        // Remove the open tag from the stack
        ComponentTag lastEnclosure = stack.pop();

        // If the child attribute has not been given by the user,
        // then ...
        if (childId != null)
        {
          lastEnclosure.put(CHILD_ATTRIBUTE, childId);
          lastEnclosure.setModified(true);
          childId = null;
        }

        if (stack.size() == 0)
        {
          stack = null;
        }
      }
      else
      {
        throw new WicketParseException("Open-close tag not allowed for Enclosure:", tag);
      }
    }
    // Are we inside a wicket:enclosure tag?
    else if (stack != null)
    {
      ComponentTag lastEnclosure = stack.lastElement();

      // If the enclosure tag has NO child attribute, then ...
      if (lastEnclosure.getAttribute(CHILD_ATTRIBUTE) == null)
      {
        String id = tag.getAttribute(getWicketNamespace() + ":id");
        if (id != null)
        {
          // We encountered more than one child component inside
          // the enclosure and are not able to automatically
          // determine the child component to delegate the
          // isVisible() to => Exception
          if (childId != null)
          {
            throw new WicketParseException("Use <" + getWicketNamespace() +
              ":enclosure child='xxx'> to name the child component:", tag);
          }
          // Remember the child id. The open tag will be updated
          // once the close tag is found. See above.
          childId = id;
View Full Code Here

      // If the tag is not a well-known wicket namespace tag
      if (!isWellKnown(tag))
      {
        // give up
        throw new WicketParseException("Unknown tag name with Wicket namespace: '" +
          tag.getName() + "'. Might be you haven't installed the appropriate resolver?",
          tag);
      }
    }

    if (wicketIdValue != null)
    {
      if (wicketIdValue.trim().length() == 0)
      {
        throw new WicketParseException(
          "The wicket:id attribute value must not be empty. May be unmatched quotes?!?",
          tag);
      }
      // Make it a wicket component. Otherwise it would be RawMarkup
      tag.setId(wicketIdValue);
View Full Code Here

    }

    // remove tag must not be open-close tags
    if (tag.isOpenClose())
    {
      throw new WicketParseException("Wicket remove tag must not be an open-close tag:", tag);
    }

    // fetch markup elements
    MarkupElement markupElement;
    while ((markupElement = getNextFilter().nextElement()) != null)
    {
      // skip non-component tags
      if((markupElement instanceof ComponentTag) == false)
      {
        continue;
      }

      // find the corresponding close tag for the given tag
      ComponentTag closeTag = (ComponentTag)markupElement;

      // No Wicket component tags are allowed within the preview region.
      // Wicket components will a component name assigned.
      if (closeTag.getId() == null)
      {
        continue;
      }

      // The first Wicket component following the preview region open
      // tag, must be it's corresponding close tag.
      if (closeTag.closes(tag))
      {
        // The tag (from open to close) should be ignored by
        // MarkupParser and not be added to the Markup.
        tag.setIgnore(true);
        return tag;
      }

      throw new WicketParseException(
        "Markup remove regions must not contain Wicket component tags:", closeTag);
    }

    throw new WicketParseException(
      "Did not find close tag for markup remove region. Open tag:", tag);
  }
View Full Code Here

      // the child attribute of the open tag if required
      else if (tag.isClose())
      {
        if (stack == null)
        {
          throw new WicketParseException("Missing open tag for Enclosure:", tag);
        }

        // Remove the open tag from the stack
        ComponentTag lastEnclosure = stack.pop();

        // If the child attribute has not been given by the user,
        // then ...
        if (childId != null)
        {
          lastEnclosure.put(CHILD_ATTRIBUTE, childId);
          lastEnclosure.setModified(true);
          childId = null;
        }

        if (stack.size() == 0)
        {
          stack = null;
        }
      }
      else
      {
        throw new WicketParseException("Open-close tag not allowed for Enclosure:", tag);
      }
    }
    // Are we inside a wicket:enclosure tag?
    else if ((tag.getId() != null) && (isWicketTag == false) && (stack != null) &&
      (!tag.isAutoComponentTag()))
    {
      ComponentTag lastEnclosure = stack.lastElement();

      // If the enclosure tag has NO child attribute, then ...
      if (lastEnclosure.getAttribute(CHILD_ATTRIBUTE) == null)
      {
        // We encountered more than one child component inside
        // the enclosure and are not able to automatically
        // determine the child component to delegate the
        // isVisible() to => Exception
        if (childId != null)
        {
          throw new WicketParseException(
            "Use <wicket:enclosure child='xxx'> to name the child component:", tag);
        }
        // Remember the child id. The open tag will be updated
        // once the close tag is found. See above.
        childId = tag.getId();
View Full Code Here

      // If the tag is not a well-known wicket namespace tag
      if (!isWellKnown(tag))
      {
        // give up
        throw new WicketParseException("Unknown tag name with Wicket namespace: '" +
          tag.getName() + "'. Might be you haven't installed the appropriate resolver?",
          tag);
      }
    }

    if (wicketIdValue != null)
    {
      if (wicketIdValue.trim().length() == 0)
      {
        throw new WicketParseException(
          "The wicket:id attribute value must not be empty. May be unmatched quotes?!?",
          tag);
      }
      // Make it a wicket component. Otherwise it would be RawMarkup
      tag.setId(wicketIdValue);
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.WicketParseException

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.