[java-metadata-aggregator COMMIT] in /trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom: AbstractXS...
noreply at shibboleth.net
noreply at shibboleth.net
Mon Mar 19 12:25:09 GMT 2012
Author: lajoie
Date: Mon Mar 19 12:25:09 2012
New Revision: 183
URL: http://svn.shibboleth.net/view/java-metadata-aggregator?rev=183&view=rev
Log:
Add constraint annotations
Minor code clean ups and constraint checks
Modified:
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractXSLProcessingStage.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomElementItem.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomElementSerializer.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomFilesystemSourceStage.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomResourceSourceStage.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/MultiOutputXSLTransformationStage.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/SimpleNamespaceContext.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSchemaValidationStage.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureSigningStage.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureValidationStage.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XPathFilteringStage.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XPathItemSelectionStrategy.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XSLTransformationStage.java
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XSLValidationStage.java
Modified: trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractXSLProcessingStage.java
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractXSLProcessingStage.java?rev=183&r1=182&r2=183&view=diff
==============================================================================
--- trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractXSLProcessingStage.java (original)
+++ trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/AbstractXSLProcessingStage.java Mon Mar 19 12:25:09 2012
@@ -23,6 +23,8 @@
import java.util.Map;
import java.util.Map.Entry;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import javax.annotation.concurrent.ThreadSafe;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.Templates;
@@ -38,8 +40,12 @@
import net.shibboleth.metadata.WarningStatus;
import net.shibboleth.metadata.pipeline.BaseStage;
import net.shibboleth.metadata.pipeline.StageProcessingException;
+import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
+import net.shibboleth.utilities.java.support.annotation.constraint.NullableElements;
+import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
+import net.shibboleth.utilities.java.support.logic.Assert;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
import net.shibboleth.utilities.java.support.resource.Resource;
import net.shibboleth.utilities.java.support.resource.ResourceException;
@@ -47,9 +53,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/**
- * A pipeline stage which applies and XSLT to each element in the {@link DomElementItem} collection.
- *
+/**
+ * A pipeline stage which applies and XSLT to each element in the {@link DomElementItem} collection.
+ *
* <p>
* This stage requires the following properties be set prior to initialization:
* <ul>
@@ -86,7 +92,7 @@
*
* @return resource that provides the XSL document
*/
- public Resource getXslResource() {
+ @Nullable public Resource getXslResource() {
return xslResource;
}
@@ -95,11 +101,11 @@
*
* @param resource resource that provides the XSL document
*/
- public synchronized void setXslResource(final Resource resource) {
+ public synchronized void setXslResource(@Nonnull final Resource resource) {
ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-
- xslResource = resource;
+
+ xslResource = Assert.isNotNull(resource, "XSL resource can not be null");
}
/**
@@ -107,7 +113,7 @@
*
* @return unmodifiable collection of attributes used by the XSLT transformer, never null nor containing null keys
*/
- public Map<String, Object> getTransformAttributes() {
+ @Nonnull @NonnullElements @Unmodifiable public Map<String, Object> getTransformAttributes() {
return transformAttributes;
}
@@ -116,7 +122,7 @@
*
* @param attributes collection of attributes used by the XSLT transformer, may be null or contain null keys
*/
[... 1355 lines stripped ...]
More information about the commits
mailing list