git://wamblee.org
/
xmlrouter
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
equals and hashcode for robust identifiable.
[xmlrouter]
/
impl
/
src
/
main
/
java
/
org
/
wamblee
/
xmlrouter
/
impl
/
RobustDocumentType.java
diff --git
a/impl/src/main/java/org/wamblee/xmlrouter/impl/RobustDocumentType.java
b/impl/src/main/java/org/wamblee/xmlrouter/impl/RobustDocumentType.java
index 34664e848188e3636f92171738018822e0135857..3f26f7b7c761fd57b2677ae9f5cd63f86d68286f 100644
(file)
--- a/
impl/src/main/java/org/wamblee/xmlrouter/impl/RobustDocumentType.java
+++ b/
impl/src/main/java/org/wamblee/xmlrouter/impl/RobustDocumentType.java
@@
-20,7
+20,6
@@
import java.util.logging.Logger;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.dom.DOMSource;
-import org.wamblee.xmlrouter.common.Id;
import org.wamblee.xmlrouter.config.DocumentType;
/**
import org.wamblee.xmlrouter.config.DocumentType;
/**
@@
-30,12
+29,12
@@
import org.wamblee.xmlrouter.config.DocumentType;
* @author Erik Brakkee
*
*/
* @author Erik Brakkee
*
*/
-public class RobustDocumentType implements DocumentType {
+public class RobustDocumentType extends RobustIdentifiable<DocumentType>
+ implements DocumentType {
private static final Logger LOGGER = Logger
.getLogger(RobustDocumentType.class.getName());
private static final Logger LOGGER = Logger
.getLogger(RobustDocumentType.class.getName());
- private Id<DocumentType> id;
private DocumentType type;
/**
private DocumentType type;
/**
@@
-46,8
+45,8
@@
public class RobustDocumentType implements DocumentType {
* @param aType
* Document type to wrap.
*/
* @param aType
* Document type to wrap.
*/
- public RobustDocumentType(
Id<DocumentType> aId
, DocumentType aType) {
-
id = aId
;
+ public RobustDocumentType(
String aPrefix
, DocumentType aType) {
+
super(aPrefix, aType)
;
type = aType;
}
type = aType;
}
@@
-56,13
+55,13
@@
public class RobustDocumentType implements DocumentType {
try {
String name = type.getName();
if (name == null) {
try {
String name = type.getName();
if (name == null) {
- LOGGER.log(Level.WARNING, "Document type " +
id
+
+ LOGGER.log(Level.WARNING, "Document type " +
getId()
+
" returned null for name");
return Constants.UNKNOWN_DOCUMENT_TYPE.toString();
}
return name;
} catch (Exception e) {
" returned null for name");
return Constants.UNKNOWN_DOCUMENT_TYPE.toString();
}
return name;
} catch (Exception e) {
- LOGGER.log(Level.WARNING, "Document type " +
id
+
+ LOGGER.log(Level.WARNING, "Document type " +
getId()
+
" threw exception", e);
return Constants.UNKNOWN_DOCUMENT_TYPE.toString();
}
" threw exception", e);
return Constants.UNKNOWN_DOCUMENT_TYPE.toString();
}
@@
-73,7
+72,7
@@
public class RobustDocumentType implements DocumentType {
try {
return type.isInstance(aSource);
} catch (Exception e) {
try {
return type.isInstance(aSource);
} catch (Exception e) {
- LOGGER.log(Level.WARNING, "Document type " +
id
+
+ LOGGER.log(Level.WARNING, "Document type " +
getId()
+
" threw exception", e);
return false;
}
" threw exception", e);
return false;
}
@@
-84,7
+83,7
@@
public class RobustDocumentType implements DocumentType {
try {
return type.validate(aSource);
} catch (Exception e) {
try {
return type.validate(aSource);
} catch (Exception e) {
- LOGGER.log(Level.WARNING, "Document type " +
id
+
+ LOGGER.log(Level.WARNING, "Document type " +
getId()
+
" threw exception", e);
return false;
}
" threw exception", e);
return false;
}