提交 5c20c976 编写于 作者: J Juergen Hoeller

Polishing

上级 82f1340c
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -29,8 +29,8 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator; ...@@ -29,8 +29,8 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
* Generic auto proxy creator that builds AOP proxies for specific beans * Generic auto proxy creator that builds AOP proxies for specific beans
* based on detected Advisors for each bean. * based on detected Advisors for each bean.
* *
* <p>Subclasses must implement the abstract {@link #findCandidateAdvisors()} * <p>Subclasses may override the {@link #findCandidateAdvisors()} method to
* method to return a list of Advisors applying to any object. Subclasses can * return a custom list of Advisors applying to any object. Subclasses can
* also override the inherited {@link #shouldSkip} method to exclude certain * also override the inherited {@link #shouldSkip} method to exclude certain
* objects from auto-proxying. * objects from auto-proxying.
* *
...@@ -153,7 +153,7 @@ public abstract class AbstractAdvisorAutoProxyCreator extends AbstractAutoProxyC ...@@ -153,7 +153,7 @@ public abstract class AbstractAdvisorAutoProxyCreator extends AbstractAutoProxyC
* <p>The default implementation is empty. * <p>The default implementation is empty.
* <p>Typically used to add Advisors that expose contextual information * <p>Typically used to add Advisors that expose contextual information
* required by some of the later advisors. * required by some of the later advisors.
* @param candidateAdvisors Advisors that have already been identified as * @param candidateAdvisors the Advisors that have already been identified as
* applying to a given bean * applying to a given bean
*/ */
protected void extendAdvisors(List<Advisor> candidateAdvisors) { protected void extendAdvisors(List<Advisor> candidateAdvisors) {
......
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -27,7 +27,7 @@ import org.springframework.core.io.ClassPathResource; ...@@ -27,7 +27,7 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
/** /**
* EntityResolver implementation for the Spring beans DTD, * {@link EntityResolver} implementation for the Spring beans DTD,
* to load the DTD from the Spring class path (or JAR file). * to load the DTD from the Spring class path (or JAR file).
* *
* <p>Fetches "spring-beans-2.0.dtd" from the class path resource * <p>Fetches "spring-beans-2.0.dtd" from the class path resource
...@@ -57,6 +57,7 @@ public class BeansDtdResolver implements EntityResolver { ...@@ -57,6 +57,7 @@ public class BeansDtdResolver implements EntityResolver {
logger.trace("Trying to resolve XML entity with public ID [" + publicId + logger.trace("Trying to resolve XML entity with public ID [" + publicId +
"] and system ID [" + systemId + "]"); "] and system ID [" + systemId + "]");
} }
if (systemId != null && systemId.endsWith(DTD_EXTENSION)) { if (systemId != null && systemId.endsWith(DTD_EXTENSION)) {
int lastPathSeparator = systemId.lastIndexOf('/'); int lastPathSeparator = systemId.lastIndexOf('/');
int dtdNameStart = systemId.indexOf(DTD_NAME, lastPathSeparator); int dtdNameStart = systemId.indexOf(DTD_NAME, lastPathSeparator);
...@@ -80,11 +81,10 @@ public class BeansDtdResolver implements EntityResolver { ...@@ -80,11 +81,10 @@ public class BeansDtdResolver implements EntityResolver {
logger.debug("Could not resolve beans DTD [" + systemId + "]: not found in classpath", ex); logger.debug("Could not resolve beans DTD [" + systemId + "]: not found in classpath", ex);
} }
} }
} }
} }
// Use the default behavior -> download from website or wherever. // Fall back to the parser's default behavior.
return null; return null;
} }
......
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2019 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -37,15 +37,15 @@ import org.springframework.util.CollectionUtils; ...@@ -37,15 +37,15 @@ import org.springframework.util.CollectionUtils;
* {@link EntityResolver} implementation that attempts to resolve schema URLs into * {@link EntityResolver} implementation that attempts to resolve schema URLs into
* local {@link ClassPathResource classpath resources} using a set of mappings files. * local {@link ClassPathResource classpath resources} using a set of mappings files.
* *
* <p>By default, this class will look for mapping files in the classpath using the pattern: * <p>By default, this class will look for mapping files in the classpath using the
* {@code META-INF/spring.schemas} allowing for multiple files to exist on the * pattern: {@code META-INF/spring.schemas} allowing for multiple files to exist on
* classpath at any one time. * the classpath at any one time.
* *
* The format of {@code META-INF/spring.schemas} is a properties * <p>The format of {@code META-INF/spring.schemas} is a properties file where each line
* file where each line should be of the form {@code systemId=schema-location} * should be of the form {@code systemId=schema-location} where {@code schema-location}
* where {@code schema-location} should also be a schema file in the classpath. * should also be a schema file in the classpath. Since systemId is commonly a URL,
* Since systemId is commonly a URL, one must be careful to escape any ':' characters * one must be careful to escape any ':' characters which are treated as delimiters
* which are treated as delimiters in properties files. * in properties files.
* *
* <p>The pattern for the mapping files can be overidden using the * <p>The pattern for the mapping files can be overidden using the
* {@link #PluggableSchemaResolver(ClassLoader, String)} constructor * {@link #PluggableSchemaResolver(ClassLoader, String)} constructor
...@@ -100,6 +100,7 @@ public class PluggableSchemaResolver implements EntityResolver { ...@@ -100,6 +100,7 @@ public class PluggableSchemaResolver implements EntityResolver {
this.schemaMappingsLocation = schemaMappingsLocation; this.schemaMappingsLocation = schemaMappingsLocation;
} }
@Override @Override
public InputSource resolveEntity(String publicId, String systemId) throws IOException { public InputSource resolveEntity(String publicId, String systemId) throws IOException {
if (logger.isTraceEnabled()) { if (logger.isTraceEnabled()) {
...@@ -127,6 +128,8 @@ public class PluggableSchemaResolver implements EntityResolver { ...@@ -127,6 +128,8 @@ public class PluggableSchemaResolver implements EntityResolver {
} }
} }
} }
// Fall back to the parser's default behavior.
return null; return null;
} }
...@@ -165,7 +168,7 @@ public class PluggableSchemaResolver implements EntityResolver { ...@@ -165,7 +168,7 @@ public class PluggableSchemaResolver implements EntityResolver {
@Override @Override
public String toString() { public String toString() {
return "EntityResolver using mappings " + getSchemaMappings(); return "EntityResolver using schema mappings " + getSchemaMappings();
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册