org.apache.neethi.builders
Interface AssertionBuilder<T>

All Known Implementing Classes:
XMLPrimitiveAssertionBuilder

public interface AssertionBuilder<T>

AssertionBuilder is the interface which must implement by any CustomAssertionBuilder. It defines a single method which takes an element definitionand an AssertionFactory instance and creates an Assertion. The AssertionBuilder must use one of the types for which there is a Converter registered. By default, that would be either an Element, and XMLStreamReader, or OMElement (if Axiom is available). Custom AssertionBuilder authors can use the AssertionFactory specified to build Assertions for any unknown elements inside the given element. They are given the opportunity to control the behavior of Assertion operations based on the corresponding domain policy assertion of the given element and the level of its processing.


Method Summary
 Assertion build(T element, AssertionBuilderFactory factory)
          Constructs an assertion from a known element.
 QName[] getKnownElements()
          Returns an array of QNames of elements from which assertion can be built by this AssertionFactory.
 

Method Detail

build

Assertion build(T element,
                AssertionBuilderFactory factory)
                throws IllegalArgumentException
Constructs an assertion from a known element. If that element contains other child elements that the Builder doesn't understand, it uses the AssertionBuilderFactory to construct assertions from them.

Parameters:
element - the known element from which an assertion can be built
factory - the factory from which AssertionBuilders are taken to build assertion from unknown child elements
Returns:
an Assertion built from the given element
Throws:
IllegalArgumentException - if the given element is malformed

getKnownElements

QName[] getKnownElements()
Returns an array of QNames of elements from which assertion can be built by this AssertionFactory.

Returns:
an array of QNames of known elements


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.