Package org.staxnav

Examples of org.staxnav.StaxNavException


            try {
                formatter.before(writer, event);
                closure.execute(writer);
                formatter.after(writer, event);
            } catch (XMLStreamException e) {
                throw new StaxNavException(e);
            }
        }
View Full Code Here


                    }
                });

                writer.flush();
            } catch (XMLStreamException e) {
                throw new StaxNavException(e);
            } finally {
                try {
                    writer.close();
                } catch (XMLStreamException e) {
                }
View Full Code Here

      return this;
   }

   public StaxWriter<N> writeEndElement() throws StaxNavException
   {
      if (elementStack.isEmpty()) throw new StaxNavException(null, "No matching startElement was found for this endElement");

      elementStack.pop().end();

      return this;
   }
View Full Code Here

            closure.execute(writer);
            formatter.after(writer, event);
         }
         catch (XMLStreamException e)
         {
            throw new StaxNavException(e);
         }
      }
View Full Code Here

            writer.flush();
         }
         catch (XMLStreamException e)
         {
            throw new StaxNavException(e);
         }
         finally
         {
            try
            {
View Full Code Here

   public static String getRequiredAttribute(StaxNavigator navigator, String attributeName) throws StaxNavException
   {
      String value = navigator.getAttribute(attributeName);
      if (value == null)
      {
         throw new StaxNavException(navigator.getLocation(), "Attribute '" + attributeName + "' is required for element '" + navigator.getLocalName() + "'");
      }

      return value;
   }
View Full Code Here

   public static StaxNavException expectedElement(StaxNavigator navigator, String expected)
   {
      StringBuilder message = new StringBuilder().append("Expected '").append(expected)
         .append("' but found '").append(navigator.getLocalName()).append("' instead.");

      return new StaxNavException(navigator.getLocation(), message.toString());
   }
View Full Code Here

      return new StaxNavException(navigator.getLocation(), message.toString());
   }

   public static StaxNavException unexpectedElement(StaxNavigator navigator)
   {
      return new StaxNavException(navigator.getLocation(), "Unexpected element '" + navigator.getLocalName() + "'");
   }
View Full Code Here

      return new StaxNavException(navigator.getLocation(), "Unexpected element '" + navigator.getLocalName() + "'");
   }

   public static StaxNavException unknownElement(StaxNavigator navigator)
   {
      return new StaxNavException(navigator.getLocation(), "Unknown element '" + navigator.getLocalName() + "'");
   }
View Full Code Here

      return new StaxNavException(navigator.getLocation(), "Unknown element '" + navigator.getLocalName() + "'");
   }

   public static StaxNavException invalidSequence(StaxNavigator navigator)
   {
      return new StaxNavException(navigator.getLocation(), "Element '" + navigator.getLocalName() + "' is out of sequence.");
   }
View Full Code Here

TOP

Related Classes of org.staxnav.StaxNavException

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.