1616
1717import org .hibernate .boot .MappingNotFoundException ;
1818import org .hibernate .boot .archive .spi .InputStreamAccess ;
19- import org .hibernate .boot .jaxb .JaxbLogger ;
2019import org .hibernate .boot .jaxb .Origin ;
2120import org .hibernate .boot .jaxb .SourceType ;
2221import org .hibernate .boot .jaxb .spi .XmlSource ;
2322import org .hibernate .boot .registry .classloading .spi .ClassLoaderService ;
2423
2524import org .w3c .dom .Document ;
2625
26+ import static org .hibernate .boot .jaxb .JaxbLogger .JAXB_LOGGER ;
27+
2728/**
2829 * Helper for building and handling {@link XmlSource} references.
2930 * <p>
@@ -38,7 +39,7 @@ public class XmlSources {
3839 * Create an {@link XmlSource} from a named resource
3940 */
4041 public static XmlSource fromResource (String resourceName , ClassLoaderService classLoaderService ) {
41- JaxbLogger . JAXB_LOGGER .tracef ( "reading mappings from resource : %s" , resourceName );
42+ JAXB_LOGGER .tracef ( "Reading mappings from resource: %s" , resourceName );
4243
4344 final Origin origin = new Origin ( SourceType .RESOURCE , resourceName );
4445 final URL url = classLoaderService .locateResource ( resourceName );
@@ -54,15 +55,15 @@ public static XmlSource fromResource(String resourceName, ClassLoaderService cla
5455 */
5556 public static XmlSource fromUrl (URL url ) {
5657 final String urlExternalForm = url .toExternalForm ();
57- JaxbLogger . JAXB_LOGGER .tracef ( "Reading mapping document from URL : %s" , urlExternalForm );
58+ JAXB_LOGGER .tracef ( "Reading mapping document from URL: %s" , urlExternalForm );
5859
5960 final Origin origin = new Origin ( SourceType .URL , urlExternalForm );
6061 return new UrlXmlSource ( origin , url );
6162 }
6263
6364 public static XmlSource fromFile (File file ) {
6465 final String filePath = file .getPath ();
65- JaxbLogger . JAXB_LOGGER .tracef ( "reading mappings from file : %s" , filePath );
66+ JAXB_LOGGER .tracef ( "Reading mappings from file: %s" , filePath );
6667
6768 final Origin origin = new Origin ( SourceType .FILE , filePath );
6869
@@ -87,29 +88,29 @@ public static XmlSource fromCacheableFile(File file, boolean strict) {
8788
8889 public static XmlSource fromCacheableFile (File file , File cacheableDir , boolean strict ) {
8990 final String filePath = file .getPath ();
90- JaxbLogger . JAXB_LOGGER .tracef ( "reading mappings from cacheable-file : %s" , filePath );
91+ JAXB_LOGGER .tracef ( "Reading mappings from cacheable file : %s" , filePath );
9192
9293 final Origin origin = new Origin ( SourceType .FILE , filePath );
9394 return new CacheableFileXmlSource ( origin , file , cacheableDir , strict );
9495 }
9596
9697 public static XmlSource fromStream (InputStreamAccess inputStreamAccess ) {
9798 final String streamName = inputStreamAccess .getStreamName ();
98- JaxbLogger . JAXB_LOGGER .tracef ( "reading mappings from InputStreamAccess : %s" , streamName );
99+ JAXB_LOGGER .tracef ( "Reading mappings from InputStreamAccess: %s" , streamName );
99100
100101 final Origin origin = new Origin ( SourceType .INPUT_STREAM , streamName );
101102 return new InputStreamAccessXmlSource ( origin , inputStreamAccess );
102103 }
103104
104105 public static XmlSource fromStream (InputStream inputStream ) {
105- JaxbLogger . JAXB_LOGGER .trace ( "reading mappings from InputStream" );
106+ JAXB_LOGGER .trace ( "reading mappings from InputStream" );
106107
107108 final Origin origin = new Origin ( SourceType .INPUT_STREAM , null );
108109 return new InputStreamXmlSource ( origin , inputStream , false );
109110 }
110111
111112 public static XmlSource fromDocument (Document document ) {
112- JaxbLogger . JAXB_LOGGER .trace ( "reading mappings from DOM" );
113+ JAXB_LOGGER .trace ( "reading mappings from DOM" );
113114 final Origin origin = new Origin ( SourceType .DOM , Origin .UNKNOWN_FILE_PATH );
114115 return new JaxpSourceXmlSource ( origin , new DOMSource ( document ) );
115116 }
@@ -125,7 +126,7 @@ public static XmlSource fromDocument(Document document) {
125126 * @param consumer a consumer of the resulting {@linkplain XmlSource XML sources}
126127 */
127128 public static void fromJar (File jar , Consumer <XmlSource > consumer ) {
128- JaxbLogger . JAXB_LOGGER .tracef ( "Seeking mapping documents in jar file : %s" , jar .getName () );
129+ JAXB_LOGGER .tracef ( "Seeking mapping documents in jar file: %s" , jar .getName () );
129130
130131 final Origin origin = new Origin ( SourceType .JAR , jar .getAbsolutePath () );
131132
@@ -134,7 +135,7 @@ public static void fromJar(File jar, Consumer<XmlSource> consumer) {
134135 while ( entries .hasMoreElements () ) {
135136 final JarEntry jarEntry = entries .nextElement ();
136137 if ( jarEntry .getName ().endsWith (".hbm.xml" ) ) {
137- JaxbLogger . JAXB_LOGGER .tracef ( "Found hbm.xml mapping in jar : %s" , jarEntry .getName () );
138+ JAXB_LOGGER .tracef ( "Found ' hbm.xml' mapping in jar: %s" , jarEntry .getName () );
138139 consumer .accept ( new JarFileEntryXmlSource ( origin , jarFile , jarEntry ) );
139140 }
140141 }
0 commit comments