Package org.staxnav

Examples of org.staxnav.StaxNavException


                    lang = new Locale(langISO.toLowerCase());
                } else {
                    lang = new Locale(langISO.toLowerCase(), countryISO.toLowerCase());
                }
            } else {
                throw new StaxNavException(navigator.getLocation(), "The attribute xml:lang='" + attribute
                        + "' does not represent a valid language pattern (ie: en, en-us).");
            }
        }

        String value = StaxNavUtils.getRequiredContent(navigator, false);
View Full Code Here


        if (portalLayout == null) {
            portalLayout = PortalConfig.DEFAULT_LAYOUT;
        } else {
            int count = countPageBodyElements(portalLayout, 0);
            if (count < 1) {
                throw new StaxNavException("No page-body element found.");
            } else if (count > 1) {
                throw new StaxNavException("Multiple page-body elements found.");
            }
        }

        portalConfig.setPortalLayout(portalLayout);
View Full Code Here

                    lang = new Locale(langISO.toLowerCase());
                } else {
                    lang = new Locale(langISO.toLowerCase(), countryISO.toLowerCase());
                }
            } else {
                throw new StaxNavException(navigator.getLocation(), "The attribute xml:lang='" + attribute
                        + "' does not represent a valid language pattern (ie: en, en-us).");
            }
        }

        String value = StaxNavUtils.getRequiredContent(navigator, false);
View Full Code Here

               lang = new Locale(langISO.toLowerCase(), countryISO.toLowerCase());
            }
         }
         else
         {
            throw new StaxNavException(navigator.getLocation(), "The attribute xml:lang='" + attribute + "' does not represent a valid language pattern (ie: en, en-us).");
         }
      }

      String value = StaxNavUtils.getRequiredContent(navigator, false);
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

    public static StaxNavException unexpectedElement(StaxNavigator navigator) {
        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

    public static StaxNavException unknownElement(StaxNavigator navigator) {
        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

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

    public static StaxNavException contentRequired(StaxNavigator navigator) {
        return new StaxNavException(navigator.getLocation(), "Content for element '" + navigator.getLocalName()
                + "' is required.");
    }
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.