import javax.xml.transform.dom.DOMSource;
-import org.wamblee.xmlrouter.common.Id;
import org.wamblee.xmlrouter.config.DocumentType;
/**
* @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 Id<DocumentType> id;
private DocumentType type;
/**
* @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;
}
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) {
- LOGGER.log(Level.WARNING, "Document type " + id +
+ LOGGER.log(Level.WARNING, "Document type " + getId() +
" threw exception", e);
return Constants.UNKNOWN_DOCUMENT_TYPE.toString();
}
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;
}
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;
}