1 16 package org.apache.cocoon.components.source.impl; 17 18 import org.apache.cocoon.components.source.SourceDescriptor; 19 import org.apache.cocoon.components.source.helpers.SourceProperty; 20 import org.apache.excalibur.source.Source; 21 import org.apache.excalibur.source.SourceException; 22 23 34 public abstract class AbstractConfigurableSourceDescriptor 35 extends AbstractConfigurableSourceInspector implements SourceDescriptor { 36 37 38 40 45 public final void removeSourceProperty(Source source, String namespace, String name) 46 throws SourceException { 47 48 if (handlesProperty(namespace,name)) { 49 if (getLogger().isDebugEnabled()) { 50 getLogger().debug("Removing property " + namespace + "#" 51 + name + " from source " + source.getURI()); 52 } 53 doRemoveSourceProperty(source,namespace,name); 54 } 55 } 56 57 62 public final void setSourceProperty(Source source, SourceProperty property) 63 throws SourceException { 64 65 if (handlesProperty(property.getNamespace(),property.getName())) { 66 if (getLogger().isDebugEnabled()) { 67 getLogger().debug("Setting property " + property.getNamespace() + "#" 68 + property.getName() + " on source " + source.getURI()); 69 } 70 doSetSourceProperty(source,property); 71 } 72 } 73 74 76 79 protected abstract void doRemoveSourceProperty(Source source, String namespace,String name) 80 throws SourceException; 81 82 85 protected abstract void doSetSourceProperty(Source source, SourceProperty property) 86 throws SourceException; 87 88 } 89 | Popular Tags |