HHH-6271 Javadocs and some generics fixes

This commit is contained in:
Hardy Ferentschik 2012-03-15 11:36:08 +01:00 committed by Strong Liu
parent ddcd060441
commit 8373871c30
3 changed files with 13 additions and 8 deletions

View File

@ -61,6 +61,7 @@ import org.dom4j.Element;
import org.jboss.logging.Logger;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXParseException;
import org.hibernate.AnnotationException;
import org.hibernate.DuplicateMappingException;
@ -1814,7 +1815,7 @@ public class Configuration implements Serializable {
*
* @param propertyName The name of the property
*
* @return The value curently associated with that property name; may be null.
* @return The value currently associated with that property name; may be null.
*/
public String getProperty(String propertyName) {
return properties.getProperty( propertyName );
@ -2001,7 +2002,7 @@ public class Configuration implements Serializable {
*/
protected Configuration doConfigure(InputStream stream, String resourceName) throws HibernateException {
try {
List errors = new ArrayList();
List errors = new ArrayList<SAXParseException>();
Document document = xmlHelper.createSAXReader( resourceName, errors, entityResolver )
.read( new InputSource( stream ) );
if ( errors.size() != 0 ) {

View File

@ -33,7 +33,7 @@ import org.hibernate.internal.CoreMessageLogger;
/**
* Implements an {@link ErrorHandler} that mainly just logs errors/warnings. However, it does track
* the intial error it encounters and makes it available via {@link #getError}.
* the initial error it encounters and makes it available via {@link #getError}.
*
* @author Steve Ebersole
*/

View File

@ -52,10 +52,14 @@ public final class XMLHelper {
private SAXReader saxReader;
/**
* Create a dom4j SAXReader which will append all validation errors
* to errorList
* @param file the file name of the xml file to parse
* @param errorsList a list to which to add all occurring errors
* @param entityResolver an xml entity resolver
*
* @return Create and return a dom4j {@code SAXReader} which will append all validation errors
* to the passed error list
*/
public SAXReader createSAXReader(String file, List errorsList, EntityResolver entityResolver) {
public SAXReader createSAXReader(String file, List<SAXParseException> errorsList, EntityResolver entityResolver) {
SAXReader saxReader = resolveSAXReader();
saxReader.setEntityResolver(entityResolver);
saxReader.setErrorHandler( new ErrorLogger(file, errorsList) );
@ -72,7 +76,7 @@ public final class XMLHelper {
}
/**
* Create a dom4j DOMReader
* @return create and return a dom4j DOMReader
*/
public DOMReader createDOMReader() {
if (domReader==null) domReader = new DOMReader();
@ -83,7 +87,7 @@ public final class XMLHelper {
private String file;
private List<SAXParseException> errors;
private ErrorLogger(String file, List errors) {
private ErrorLogger(String file, List<SAXParseException> errors) {
this.file=file;
this.errors = errors;
}