initial versions.
[xmlrouter] / config / src / main / java / org / wamblee / xmlrouter / config / DocumentType.java
diff --git a/config/src/main/java/org/wamblee/xmlrouter/config/DocumentType.java b/config/src/main/java/org/wamblee/xmlrouter/config/DocumentType.java
new file mode 100644 (file)
index 0000000..edcf294
--- /dev/null
@@ -0,0 +1,27 @@
+package org.wamblee.xmlrouter.config;
+
+import javax.xml.transform.dom.DOMSource;
+
+public interface DocumentType {
+    
+    /**
+     * Symbolic name for the document type. 
+     * @return Name. 
+     */
+    String getName();
+
+    /**
+     * Checks if a document is of the given type. 
+     * @param aSource Document
+     * @return True iff the document is of the given type. 
+     */
+    boolean isInstance(DOMSource aSource);
+    
+    /**
+     * Validates the document. Implementations that do not validate should simply
+     * return true always. 
+     * @param aSource Document.
+     * @return True iff the document is valid. 
+     */
+    boolean validate(DOMSource aSource);
+}