Interface ConfigurationXMLStreamReader

    • Field Detail

      • EMPTY_CHARS

        static final char[] EMPTY_CHARS
    • Method Detail

      • getUri

        URI getUri()
      • hasNamespace

        default boolean hasNamespace()
        Determine whether the current element has a non-empty namespace URI.
        Returns:
        true if the element has a non-empty namespace URI, false otherwise
      • namespaceURIEquals

        default boolean namespaceURIEquals​(String uri)
        Determine whether the current element has a namespace URI equal to the given value. If the given value is null or empty, this method returns true only if the current element has no namespace.
        Parameters:
        uri - the namespace URI to test
        Returns:
        true if the element has a namespace URI equal to the argument, or the argument is null or empty and the element has no namespace, or false otherwise
      • hasAttributeNamespace

        default boolean hasAttributeNamespace​(int idx)
        Determine whether the current element has an attribute at the given index with a non-empty namespace URI.
        Parameters:
        idx - the attribute index
        Returns:
        true if the attribute has a non-empty namespace URI, false otherwise
      • attributeNamespaceEquals

        default boolean attributeNamespaceEquals​(int idx,
                                                 String uri)
        Determine whether the current element has an attribute at the given index with a namespace URI equal to the given value. If the given value is null or empty, this method returns true only if the attribute has no namespace.
        Parameters:
        idx - the attribute index
        uri - the namespace URI to test
        Returns:
        true if the attribute has a namespace URI equal to the argument, or the argument is null or empty and the element has no namespace, or false otherwise
      • eventToString

        static String eventToString​(int type)
      • unexpectedElement

        default ConfigXMLParseException unexpectedElement()
        Return a throwable exception explaining that the element at the current position was not expected.
        Returns:
        the exception
      • unexpectedAttribute

        default ConfigXMLParseException unexpectedAttribute​(int i)
        Return a throwable exception explaining that the attribute at the current position with the given index was not expected.
        Parameters:
        i - the attribute index
        Returns:
        the exception
      • unexpectedDocumentEnd

        default ConfigXMLParseException unexpectedDocumentEnd()
        Return a throwable exception explaining that the document end was reached unexpectedly.
        Returns:
        the exception
      • unexpectedContent

        default ConfigXMLParseException unexpectedContent()
        Return a throwable exception explaining that some unexpected content was encountered.
        Returns:
        the exception
      • missingRequiredElement

        default ConfigXMLParseException missingRequiredElement​(String namespaceUri,
                                                               String localName)
        Return a throwable exception explaining that a required element with the given namespace and local name was missing.
        Parameters:
        namespaceUri - the namespace URI
        localName - the local element name
        Returns:
        the exception
      • missingRequiredAttribute

        default ConfigXMLParseException missingRequiredAttribute​(String namespaceUri,
                                                                 String localName)
        Return a throwable exception explaining that a required attribute with the given namespace and local name was missing.
        Parameters:
        namespaceUri - the namespace URI (or null if it is a local name)
        localName - the local attribute name
        Returns:
        the exception
      • numericAttributeValueOutOfRange

        default ConfigXMLParseException numericAttributeValueOutOfRange​(int index,
                                                                        long minValue,
                                                                        long maxValue)
        Return a throwable exception explaining that a numeric attribute at the given index was out of its required range.
        Parameters:
        index - the attribute index
        minValue - the minimum attribute value
        maxValue - the maximum attribute value
        Returns:
        the exception
      • getAttributeValue

        String getAttributeValue​(int index)
        Get the value of an attribute.
        Specified by:
        getAttributeValue in interface XMLStreamReader
        Parameters:
        index - the index of the attribute
        Returns:
        the attribute value
      • getAttributeValueResolved

        default String getAttributeValueResolved​(int index)
                                          throws ConfigXMLParseException
        Get the value of an attribute with expressions resolved.
        Parameters:
        index - the index of the attribute
        Returns:
        the attribute value
        Throws:
        ConfigXMLParseException - if an error occurs
      • getIntAttributeValue

        default int getIntAttributeValue​(int index)
                                  throws ConfigXMLParseException
        Get the value of an attribute as an integer.
        Parameters:
        index - the index of the attribute
        Returns:
        the integer value
        Throws:
        ConfigXMLParseException - if an error occurs
      • getIntAttributeValueResolved

        default int getIntAttributeValueResolved​(int index)
                                          throws ConfigXMLParseException
        Get the value of an attribute as an integer with expressions resolved.
        Parameters:
        index - the index of the attribute
        Returns:
        the integer value
        Throws:
        ConfigXMLParseException - if an error occurs
      • getIntAttributeValue

        default int getIntAttributeValue​(int index,
                                         int minValue,
                                         int maxValue)
                                  throws ConfigXMLParseException
        Get the value of an attribute as an integer.
        Parameters:
        index - the index of the attribute
        minValue - the minimum allowed value
        maxValue - the maximum allowed value
        Returns:
        the integer value
        Throws:
        ConfigXMLParseException - if an error occurs
      • getIntAttributeValueResolved

        default int getIntAttributeValueResolved​(int index,
                                                 int minValue,
                                                 int maxValue)
                                          throws ConfigXMLParseException
        Get the value of an attribute as an integer with expressions resolved.
        Parameters:
        index - the index of the attribute
        minValue - the minimum allowed value
        maxValue - the maximum allowed value
        Returns:
        the integer value
        Throws:
        ConfigXMLParseException - if an error occurs
      • getIntListAttributeValue

        default int[] getIntListAttributeValue​(int index)
                                        throws ConfigXMLParseException
        Get the value of an attribute as an integer list.
        Parameters:
        index - the index of the attribute
        Returns:
        the integer values
        Throws:
        ConfigXMLParseException - if an error occurs
      • getIntListAttributeValueResolved

        default int[] getIntListAttributeValueResolved​(int index)
                                                throws ConfigXMLParseException
        Get the value of an attribute as an integer list with expressions resolved.
        Parameters:
        index - the index of the attribute
        Returns:
        the integer values
        Throws:
        ConfigXMLParseException - if an error occurs
      • getListAttributeValueAsIterator

        default Iterator<String> getListAttributeValueAsIterator​(int index)
                                                          throws ConfigXMLParseException
        Get the value of an attribute as a space-delimited string list, as an iterator.
        Parameters:
        index - the index of the attribute
        Returns:
        the values
        Throws:
        ConfigXMLParseException - if an error occurs
      • getListAttributeValueAsIteratorResolved

        default Iterator<String> getListAttributeValueAsIteratorResolved​(int index)
                                                                  throws ConfigXMLParseException
        /** Get the value of an attribute as a space-delimited string list with expressions resolved, as an iterator.
        Parameters:
        index - the index of the attribute
        Returns:
        the values
        Throws:
        ConfigXMLParseException - if an error occurs
      • getListAttributeValue

        default List<String> getListAttributeValue​(int index)
                                            throws ConfigXMLParseException
        Get the value of an attribute as a space-delimited string list.
        Parameters:
        index - the index of the attribute
        Returns:
        the values
        Throws:
        ConfigXMLParseException - if an error occurs
      • getListAttributeValueResolved

        default List<String> getListAttributeValueResolved​(int index)
                                                    throws ConfigXMLParseException
        Get the value of an attribute as a space-delimited string list with expressions resolved.
        Parameters:
        index - the index of the attribute
        Returns:
        the values
        Throws:
        ConfigXMLParseException - if an error occurs
      • getListAttributeValueAsArray

        default String[] getListAttributeValueAsArray​(int index)
                                               throws ConfigXMLParseException
        Get the value of an attribute as a space-delimited string list, as an array.
        Parameters:
        index - the index of the attribute
        Returns:
        the values
        Throws:
        ConfigXMLParseException - if an error occurs
      • getListAttributeValueAsArrayResolved

        default String[] getListAttributeValueAsArrayResolved​(int index)
                                                       throws ConfigXMLParseException
        Get the value of an attribute as a space-delimited string list with expressions resolved, as an array.
        Parameters:
        index - the index of the attribute
        Returns:
        the values
        Throws:
        ConfigXMLParseException - if an error occurs
      • getLongAttributeValue

        default long getLongAttributeValue​(int index)
                                    throws ConfigXMLParseException
        Get the value of an attribute as a long.
        Parameters:
        index - the index of the attribute
        Returns:
        the long value
        Throws:
        ConfigXMLParseException - if an error occurs
      • getLongAttributeValueResolved

        default long getLongAttributeValueResolved​(int index)
                                            throws ConfigXMLParseException
        Get the value of an attribute as a long with expressions resolved.
        Parameters:
        index - the index of the attribute
        Returns:
        the long value
        Throws:
        ConfigXMLParseException - if an error occurs
      • getLongAttributeValue

        default long getLongAttributeValue​(int index,
                                           long minValue,
                                           long maxValue)
                                    throws ConfigXMLParseException
        Get the value of an attribute as a long.
        Parameters:
        index - the index of the attribute
        minValue - the minimum allowed value
        maxValue - the maximum allowed value
        Returns:
        the long value
        Throws:
        ConfigXMLParseException - if an error occurs
      • getLongAttributeValueResolved

        default long getLongAttributeValueResolved​(int index,
                                                   long minValue,
                                                   long maxValue)
                                            throws ConfigXMLParseException
        Get the value of an attribute as a long with expressions resolved.
        Parameters:
        index - the index of the attribute
        minValue - the minimum allowed value
        maxValue - the maximum allowed value
        Returns:
        the long value
        Throws:
        ConfigXMLParseException - if an error occurs
      • getLongListAttributeValue

        default long[] getLongListAttributeValue​(int index)
                                          throws ConfigXMLParseException
        Get the value of an attribute as a long integer list.
        Parameters:
        index - the index of the attribute
        Returns:
        the long values
        Throws:
        ConfigXMLParseException - if an error occurs
      • getLongListAttributeValueResolved

        default long[] getLongListAttributeValueResolved​(int index)
                                                  throws ConfigXMLParseException
        Get the value of an attribute as a long integer list with expressions resolved.
        Parameters:
        index - the index of the attribute
        Returns:
        the long values
        Throws:
        ConfigXMLParseException - if an error occurs
      • getBooleanAttributeValue

        default boolean getBooleanAttributeValue​(int index)
        Get an attribute value as a boolean. Only the string "true" (case-insensitive) is recognized as a true value; all other strings are considered false.
        Parameters:
        index - the attribute index
        Returns:
        the attribute value
      • getBooleanAttributeValueResolved

        default boolean getBooleanAttributeValueResolved​(int index)
                                                  throws ConfigXMLParseException
        Get an attribute value as a boolean with expressions resolved. Only the string "true" (case-insensitive) is recognized as a true value; all other strings are considered false.
        Parameters:
        index - the attribute index
        Returns:
        the attribute value
        Throws:
        ConfigXMLParseException - if an error occurs
      • getURIAttributeValue

        default URI getURIAttributeValue​(int index)
                                  throws ConfigXMLParseException
        Get an attribute value as a URI.
        Parameters:
        index - the attribute index
        Returns:
        the attribute value
        Throws:
        ConfigXMLParseException - if the value is not a valid URI
      • getURIAttributeValueResolved

        default URI getURIAttributeValueResolved​(int index)
                                          throws ConfigXMLParseException
        Get an attribute value as a URI with expressions resolved.
        Parameters:
        index - the attribute index
        Returns:
        the attribute value
        Throws:
        ConfigXMLParseException - if the value is not a valid URI
      • getExpressionAttributeValue

        default Expression getExpressionAttributeValue​(int index,
                                                       Expression.Flag... flags)
                                                throws ConfigXMLParseException
        Get an attribute value as a compiled Expression.
        Parameters:
        index - the attribute index
        flags - the expression compilation flags
        Returns:
        the expression, or null if the attribute is not present
        Throws:
        ConfigXMLParseException - if the value is not a valid expression by the given flags
      • getInetAddressAttributeValueResolved

        default InetAddress getInetAddressAttributeValueResolved​(int index)
                                                          throws ConfigXMLParseException
        Get an attribute value as a InetAddress with expressions resolved.
        Parameters:
        index - the attribute index
        Returns:
        the attribute value
        Throws:
        ConfigXMLParseException - if the value is not a valid IP address
      • getCidrAddressAttributeValueResolved

        default CidrAddress getCidrAddressAttributeValueResolved​(int index)
                                                          throws ConfigXMLParseException
        Get an attribute value as a CidrAddress with expressions resolved.
        Parameters:
        index - the attribute index
        Returns:
        the attribute value
        Throws:
        ConfigXMLParseException - if the value is not a valid IP address