Created
June 23, 2015 15:23
-
-
Save altitdb/775c987e58dcf858e7f2 to your computer and use it in GitHub Desktop.
Implementação da validação de XML com XSD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void OutputJaxpImplementationInfo() { | |
System.out.println(getJaxpImplementationInfo("DocumentBuilderFactory", DocumentBuilderFactory.newInstance().getClass())); | |
System.out.println(getJaxpImplementationInfo("XPathFactory", XPathFactory.newInstance().getClass())); | |
System.out.println(getJaxpImplementationInfo("TransformerFactory", TransformerFactory.newInstance().getClass())); | |
System.out.println(getJaxpImplementationInfo("SAXParserFactory", SAXParserFactory.newInstance().getClass())); | |
} | |
private String getJaxpImplementationInfo(String componentName, Class componentClass) { | |
CodeSource source = componentClass.getProtectionDomain().getCodeSource(); | |
return MessageFormat.format( | |
"{0} implementation: {1} loaded from: {2}", | |
componentName, | |
componentClass.getName(), | |
source == null ? "Java Runtime" : source.getLocation()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment