1
1
/*
2
- * Copyright 2002-2022 the original author or authors.
2
+ * Copyright 2002-2024 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.
@@ -154,7 +154,7 @@ public SpringPersistenceUnitInfo[] readPersistenceUnitInfos(String[] persistence
154
154
/**
155
155
* Validate the given stream and return a valid DOM document for parsing.
156
156
*/
157
- protected Document buildDocument (ErrorHandler handler , InputStream stream )
157
+ Document buildDocument (ErrorHandler handler , InputStream stream )
158
158
throws ParserConfigurationException , SAXException , IOException {
159
159
160
160
DocumentBuilderFactory dbf = DocumentBuilderFactory .newInstance ();
@@ -168,9 +168,7 @@ protected Document buildDocument(ErrorHandler handler, InputStream stream)
168
168
/**
169
169
* Parse the validated document and add entries to the given unit info list.
170
170
*/
171
- protected List <SpringPersistenceUnitInfo > parseDocument (
172
- Resource resource , Document document , List <SpringPersistenceUnitInfo > infos ) throws IOException {
173
-
171
+ void parseDocument (Resource resource , Document document , List <SpringPersistenceUnitInfo > infos ) throws IOException {
174
172
Element persistence = document .getDocumentElement ();
175
173
String version = persistence .getAttribute (PERSISTENCE_VERSION );
176
174
URL rootUrl = determinePersistenceUnitRootUrl (resource );
@@ -179,14 +177,12 @@ protected List<SpringPersistenceUnitInfo> parseDocument(
179
177
for (Element unit : units ) {
180
178
infos .add (parsePersistenceUnitInfo (unit , version , rootUrl ));
181
179
}
182
-
183
- return infos ;
184
180
}
185
181
186
182
/**
187
183
* Parse the unit info DOM element.
188
184
*/
189
- protected SpringPersistenceUnitInfo parsePersistenceUnitInfo (
185
+ SpringPersistenceUnitInfo parsePersistenceUnitInfo (
190
186
Element persistenceUnit , String version , @ Nullable URL rootUrl ) throws IOException {
191
187
192
188
SpringPersistenceUnitInfo unitInfo = new SpringPersistenceUnitInfo ();
@@ -253,7 +249,7 @@ protected SpringPersistenceUnitInfo parsePersistenceUnitInfo(
253
249
/**
254
250
* Parse the {@code property} XML elements.
255
251
*/
256
- protected void parseProperties (Element persistenceUnit , SpringPersistenceUnitInfo unitInfo ) {
252
+ void parseProperties (Element persistenceUnit , SpringPersistenceUnitInfo unitInfo ) {
257
253
Element propRoot = DomUtils .getChildElementByTagName (persistenceUnit , PROPERTIES );
258
254
if (propRoot == null ) {
259
255
return ;
@@ -269,7 +265,7 @@ protected void parseProperties(Element persistenceUnit, SpringPersistenceUnitInf
269
265
/**
270
266
* Parse the {@code class} XML elements.
271
267
*/
272
- protected void parseManagedClasses (Element persistenceUnit , SpringPersistenceUnitInfo unitInfo ) {
268
+ void parseManagedClasses (Element persistenceUnit , SpringPersistenceUnitInfo unitInfo ) {
273
269
List <Element > classes = DomUtils .getChildElementsByTagName (persistenceUnit , MANAGED_CLASS_NAME );
274
270
for (Element element : classes ) {
275
271
String value = DomUtils .getTextValue (element ).trim ();
@@ -282,7 +278,7 @@ protected void parseManagedClasses(Element persistenceUnit, SpringPersistenceUni
282
278
/**
283
279
* Parse the {@code mapping-file} XML elements.
284
280
*/
285
- protected void parseMappingFiles (Element persistenceUnit , SpringPersistenceUnitInfo unitInfo ) {
281
+ void parseMappingFiles (Element persistenceUnit , SpringPersistenceUnitInfo unitInfo ) {
286
282
List <Element > files = DomUtils .getChildElementsByTagName (persistenceUnit , MAPPING_FILE_NAME );
287
283
for (Element element : files ) {
288
284
String value = DomUtils .getTextValue (element ).trim ();
@@ -295,7 +291,7 @@ protected void parseMappingFiles(Element persistenceUnit, SpringPersistenceUnitI
295
291
/**
296
292
* Parse the {@code jar-file} XML elements.
297
293
*/
298
- protected void parseJarFiles (Element persistenceUnit , SpringPersistenceUnitInfo unitInfo ) throws IOException {
294
+ void parseJarFiles (Element persistenceUnit , SpringPersistenceUnitInfo unitInfo ) throws IOException {
299
295
List <Element > jars = DomUtils .getChildElementsByTagName (persistenceUnit , JAR_FILE_URL );
300
296
for (Element element : jars ) {
301
297
String value = DomUtils .getTextValue (element ).trim ();
0 commit comments