|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2018 the original author or authors. |
| 2 | + * Copyright 2002-2019 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
37 | 37 | * {@link EntityResolver} implementation that attempts to resolve schema URLs into
|
38 | 38 | * local {@link ClassPathResource classpath resources} using a set of mappings files.
|
39 | 39 | *
|
40 |
| - * <p>By default, this class will look for mapping files in the classpath using the pattern: |
41 |
| - * {@code META-INF/spring.schemas} allowing for multiple files to exist on the |
42 |
| - * classpath at any one time. |
| 40 | + * <p>By default, this class will look for mapping files in the classpath using the |
| 41 | + * pattern: {@code META-INF/spring.schemas} allowing for multiple files to exist on |
| 42 | + * the classpath at any one time. |
43 | 43 | *
|
44 |
| - * The format of {@code META-INF/spring.schemas} is a properties |
45 |
| - * file where each line should be of the form {@code systemId=schema-location} |
46 |
| - * where {@code schema-location} should also be a schema file in the classpath. |
47 |
| - * Since systemId is commonly a URL, one must be careful to escape any ':' characters |
48 |
| - * which are treated as delimiters in properties files. |
| 44 | + * <p>The format of {@code META-INF/spring.schemas} is a properties file where each line |
| 45 | + * should be of the form {@code systemId=schema-location} where {@code schema-location} |
| 46 | + * should also be a schema file in the classpath. Since systemId is commonly a URL, |
| 47 | + * one must be careful to escape any ':' characters which are treated as delimiters |
| 48 | + * in properties files. |
49 | 49 | *
|
50 | 50 | * <p>The pattern for the mapping files can be overidden using the
|
51 | 51 | * {@link #PluggableSchemaResolver(ClassLoader, String)} constructor
|
@@ -100,6 +100,7 @@ public PluggableSchemaResolver(ClassLoader classLoader, String schemaMappingsLoc
|
100 | 100 | this.schemaMappingsLocation = schemaMappingsLocation;
|
101 | 101 | }
|
102 | 102 |
|
| 103 | + |
103 | 104 | @Override
|
104 | 105 | public InputSource resolveEntity(String publicId, String systemId) throws IOException {
|
105 | 106 | if (logger.isTraceEnabled()) {
|
@@ -127,6 +128,8 @@ public InputSource resolveEntity(String publicId, String systemId) throws IOExce
|
127 | 128 | }
|
128 | 129 | }
|
129 | 130 | }
|
| 131 | + |
| 132 | + // Fall back to the parser's default behavior. |
130 | 133 | return null;
|
131 | 134 | }
|
132 | 135 |
|
@@ -165,7 +168,7 @@ private Map<String, String> getSchemaMappings() {
|
165 | 168 |
|
166 | 169 | @Override
|
167 | 170 | public String toString() {
|
168 |
| - return "EntityResolver using mappings " + getSchemaMappings(); |
| 171 | + return "EntityResolver using schema mappings " + getSchemaMappings(); |
169 | 172 | }
|
170 | 173 |
|
171 | 174 | }
|
0 commit comments