Author: thorsten
Date: Fri Oct 10 04:53:33 2008
New Revision: 703424
URL: http://svn.apache.org/viewvc?rev=703424&view=rev
Log:
Splitting the config into a part writable and one readable only
Added:
forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/config/WritableDispatcherBean.java
(with props)
Modified:
forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/config/DispatcherBean.java
Modified:
forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/config/DispatcherBean.java
URL:
http://svn.apache.org/viewvc/forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/config/DispatcherBean.java?rev=703424&r1=703423&r2=703424&view=diff
==============================================================================
---
forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/config/DispatcherBean.java
(original)
+++
forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/config/DispatcherBean.java
Fri Oct 10 04:53:33 2008
@@ -16,7 +16,7 @@
*/
package org.apache.forrest.dispatcher.config;
-import javax.xml.transform.URIResolver;
+import javax.xml.transform.TransformerFactory;
import org.apache.forrest.dispatcher.api.Resolver;
import org.apache.forrest.dispatcher.impl.helper.StAX;
@@ -30,7 +30,7 @@
*/
public class DispatcherBean {
- private boolean shrink = true;
+ protected boolean shrink = true;
/**
* If you use properties like
@@ -48,30 +48,10 @@
* as w3c element (false)
*/
public boolean isShrink() {
- return shrink;
+ return new Boolean(shrink);
}
- /**
- * If you use properties like
- * <code><forrest:property name="theme" value="pelt"/></code>
- * <p>
- * There is no real need to pass the element as whole it is sufficient to
pass
- * a simple string (@value).
- * <p>
- * If you set it to true we will pass a simple string to the transformation
in
- * the form of [EMAIL PROTECTED], [EMAIL PROTECTED]
- * <p>
- * If set to false then we pass the whole element.
- *
- * @param shrink
- * whether we pass empty properties element as simple string (true)
- * or as w3c element (false)
- */
- public void setShrink(boolean shrink) {
- this.shrink = shrink;
- }
-
- private boolean allowXmlProperties = false;
+ protected boolean allowXmlProperties = false;
/**
* If you want to use inline xml for contract properties be aware that
setting
@@ -89,27 +69,10 @@
* children or not.
*/
public boolean isAllowXmlProperties() {
- return allowXmlProperties;
+ return new Boolean(allowXmlProperties);
}
- /**
- * If you want to use inline xml for contract properties be aware that
setting
- * this properties to true will have negative influence on performance since
- * this feature needs to use DOM parsing!<p>
- *
- * We strongly recommend to rewrite your contracts and structurer to use
- * simple string for the properties.<p> Whether we allow that
- * <code><forrest:property> elements can have children or not.
- *
- * @param Whether
- * we allow that <code><forrest:property> elements can have
- * children or not.
- */
- public void setAllowXmlProperties(boolean allowXmlProperties) {
- this.allowXmlProperties = allowXmlProperties;
- }
-
- private Resolver resolver = null;
+ protected Resolver resolver = null;
/**
* Wrapper interface to enable multible resolver implementation this makes it
@@ -122,19 +85,7 @@
return resolver;
}
- /**
- * Wrapper interface to enable multible resolver implementation this makes it
- * possible to use the dispatcher outside of cocoon as standalone application
- * without any mayor rewrites.
- *
- * @param the
- * currently configured resolver
- */
- public void setResolver(Resolver resolver) {
- this.resolver = resolver;
- }
-
- private String contractUriPrefix = "";
+ protected String contractUriPrefix = "";
/**
* If you want to change the uri prefix of the contracts. This may be
@@ -144,22 +95,10 @@
* @return prefix of the contracts
*/
public String getContractUriPrefix() {
- return contractUriPrefix;
- }
-
- /**
- * If you want to change the uri prefix of the contracts. This may be
- * interesting if you work with a contract repository rather then with the
- * ones from the themer plugin.
- *
- * @param prefix
- * of the contracts
- */
- public void setContractUriPrefix(String contractUriPrefix) {
- this.contractUriPrefix = contractUriPrefix;
+ return new String(contractUriPrefix);
}
- private String contractUriSufix = ".contract.xml";
+ protected String contractUriSufix = ".contract.xml";
/**
* If you want to change the uri suffix of the contracts. This may be
@@ -169,52 +108,27 @@
* @return suffix of the contracts
*/
public String getContractUriSufix() {
- return contractUriSufix;
+ return new String(contractUriSufix);
}
- /**
- * If you want to change the uri suffix of the contracts. This may be
- * interesting if you work with a contract repository rather then with the
- * ones from the themer plugin.
- *
- * @param suffix
- * of the contracts
- */
- public void setContractUriSufix(String contractUriSufix) {
- this.contractUriSufix = contractUriSufix;
- }
+ protected StAX staxHelper;
- private URIResolver uriResolver = null;
-
- /**
- * <p>An object that can be called by the xsl processor to turn a URI used in
- * document(), xsl:import, or xsl:include into a Source object.
- *
- * @param uriResolver
- * the uriResolver currently configured
- */
- public void setUriResolver(URIResolver uriResolver) {
- this.uriResolver = uriResolver;
+ public StAX getStaxHelper() {
+ return staxHelper;
}
-
+
+ protected TransformerFactory transFact;
+
/**
- * <p>An object that can be called by the xsl processor to turn a URI used in
- * document(), xsl:import, or xsl:include into a Source object.
+ * <p>A TransformerFactory instance can be used to create
+ * [EMAIL PROTECTED] javax.xml.transform.Transformer} and
+ * [EMAIL PROTECTED] javax.xml.transform.Templates} objects.</p>
*
- * @return uriResolver the uriResolver currently configured
+ * @return transFact the TransformerFactory currently configured
*/
- public URIResolver getUriResolver() {
- return uriResolver;
- }
-
- private StAX staxHelper;
-
- public void setStaxHelper(StAX staxHelper) {
- this.staxHelper = staxHelper;
+ public TransformerFactory getTransFact() {
+ return transFact;
}
- public StAX getStaxHelper() {
- return staxHelper;
- }
}
Added:
forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/config/WritableDispatcherBean.java
URL:
http://svn.apache.org/viewvc/forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/config/WritableDispatcherBean.java?rev=703424&view=auto
==============================================================================
---
forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/config/WritableDispatcherBean.java
(added)
+++
forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/config/WritableDispatcherBean.java
Fri Oct 10 04:53:33 2008
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.forrest.dispatcher.config;
+
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.URIResolver;
+
+import org.apache.forrest.dispatcher.api.Resolver;
+import org.apache.forrest.dispatcher.impl.helper.StAX;
+
+public class WritableDispatcherBean extends DispatcherBean {
+ /**
+ * If you use properties like
+ * <code><forrest:property name="theme" value="pelt"/></code>
+ * <p>
+ * There is no real need to pass the element as whole it is sufficient to
pass
+ * a simple string (@value).
+ * <p>
+ * If you set it to true we will pass a simple string to the transformation
in
+ * the form of [EMAIL PROTECTED], [EMAIL PROTECTED]
+ * <p>
+ * If set to false then we pass the whole element.
+ *
+ * @param shrink
+ * whether we pass empty properties element as simple string (true)
+ * or as w3c element (false)
+ */
+ public void setShrink(boolean shrink) {
+ this.shrink = shrink;
+ }
+
+ /**
+ * If you want to use inline xml for contract properties be aware that
setting
+ * this properties to true will have negative influence on performance since
+ * this feature needs to use DOM parsing!
+ * <p>
+ *
+ * We strongly recommend to rewrite your contracts and structurer to use
+ * simple string for the properties.
+ * <p>
+ * Whether we allow that
+ * <code><forrest:property> elements can have children or not.
+ *
+ * @param Whether
+ * we allow that <code><forrest:property> elements can have
+ * children or not.
+ */
+ public void setAllowXmlProperties(boolean allowXmlProperties) {
+ this.allowXmlProperties = allowXmlProperties;
+ }
+
+ /**
+ * Wrapper interface to enable multible resolver implementation this makes it
+ * possible to use the dispatcher outside of cocoon as standalone application
+ * without any mayor rewrites.
+ *
+ * @param the
+ * currently configured resolver
+ */
+ public void setResolver(Resolver resolver) {
+ this.resolver = resolver;
+ }
+
+ /**
+ * If you want to change the uri prefix of the contracts. This may be
+ * interesting if you work with a contract repository rather then with the
+ * ones from the themer plugin.
+ *
+ * @param prefix
+ * of the contracts
+ */
+ public void setContractUriPrefix(String contractUriPrefix) {
+ this.contractUriPrefix = contractUriPrefix;
+ }
+ /**
+ * If you want to change the uri suffix of the contracts. This may be
+ * interesting if you work with a contract repository rather then with the
+ * ones from the themer plugin.
+ *
+ * @param suffix
+ * of the contracts
+ */
+ public void setContractUriSufix(String contractUriSufix) {
+ this.contractUriSufix = contractUriSufix;
+ }
+
+ public void setStaxHelper(StAX staxHelper) {
+ this.staxHelper = staxHelper;
+ }
+
+ /**
+ * <p>A TransformerFactory instance can be used to create
+ * [EMAIL PROTECTED] javax.xml.transform.Transformer} and
+ * [EMAIL PROTECTED] javax.xml.transform.Templates} objects.</p>
+ *
+ * @param transFact
+ * the TransformerFactory currently configured
+ */
+ public void setTransFact(TransformerFactory transFact) {
+ this.transFact = transFact;
+ }
+
+}
Propchange:
forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/config/WritableDispatcherBean.java
------------------------------------------------------------------------------
svn:eol-style = native