Author: vgritsenko
Date: Wed Apr 13 15:11:22 2005
New Revision: 161225
URL: http://svn.apache.org/viewcvs?view=rev&rev=161225
Log:
return null validity when validity is null. ahem.
Modified:
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
Modified:
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
URL:
http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java?view=diff&r1=161224&r2=161225
==============================================================================
---
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
(original)
+++
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
Wed Apr 13 15:11:22 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,13 +51,13 @@
* by invoking a pipeline.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Id$
+ * @version $Id$
*/
public final class SitemapSource
-extends AbstractLogEnabled
-implements Source, XMLizable {
+ extends AbstractLogEnabled
+ implements Source, XMLizable {
- /** validities for the internal pipeline */
+ /** The internal event pipeline validities */
private SitemapSourceValidity validity;
/** The system id */
@@ -200,6 +200,7 @@
} finally {
EnvironmentHelper.leaveProcessor();
}
+
return new ByteArrayInputStream(os.toByteArray());
} catch (ResourceNotFoundException e) {
@@ -214,14 +215,14 @@
}
/**
- * Return the unique identifer for this source
+ * Returns the unique identifer for this source
*/
public String getURI() {
return this.systemIdForCaching;
}
/**
- *
+ * Returns true always.
* @see org.apache.excalibur.source.Source#exists()
*/
public boolean exists() {
@@ -229,13 +230,11 @@
}
/**
- * Get the Validity object. This can either wrap the last modification
- * date or the expires information or...
- * If it is currently not possible to calculate such an information
- * <code>null</code> is returned.
+ * Get the validity object. This wraps validity of the enclosed event
+ * pipeline. If pipeline is not cacheable, <code>null</code> is returned.
*/
public SourceValidity getValidity() {
- return this.validity;
+ return this.validity.getNestedValidity() == null? null: this.validity;
}
/**
@@ -431,33 +430,33 @@
*/
public static final class SitemapSourceValidity implements SourceValidity {
- private SourceValidity nested_validity = null;
+ private SourceValidity validity;
private SitemapSourceValidity() {
super();
}
private void set(SourceValidity validity) {
- this.nested_validity = validity;
+ this.validity = validity;
}
public int isValid() {
- return(this.nested_validity != null?
- this.nested_validity.isValid():
- SourceValidity.INVALID);
+ return (this.validity != null ?
+ this.validity.isValid() :
+ SourceValidity.INVALID);
}
public int isValid(SourceValidity validity) {
if (validity instanceof SitemapSourceValidity) {
- return(this.nested_validity != null?
- this.nested_validity.isValid(((SitemapSourceValidity)
validity).getNestedValidity()):
+ return (this.validity != null ?
+ this.validity.isValid(((SitemapSourceValidity)
validity).getNestedValidity()) :
SourceValidity.INVALID);
}
return SourceValidity.INVALID;
}
public SourceValidity getNestedValidity() {
- return this.nested_validity;
+ return this.validity;
}
}
}