You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2007/05/10 10:03:15 UTC
svn commit: r536771 -
/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
Author: lofwyr
Date: Thu May 10 01:03:14 2007
New Revision: 536771
URL: http://svn.apache.org/viewvc?view=rev&rev=536771
Log:
TOBAGO-393: Create OptimizedResponseWriter to move the non-standard-compliant optimization stuff to
renaming:
TobagoResponseWriter for the interface,
TobagoResponseWriterImpl for the default Tobago implementation and
TobagoResponseWriterWrapper for the implementation, which wrappes other standard writers
Added:
myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
Added: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java?view=auto&rev=536771
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java (added)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriter.java Thu May 10 01:03:14 2007
@@ -0,0 +1,89 @@
+package org.apache.myfaces.tobago.webapp;
+
+/*
+ * 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.
+ */
+
+import javax.faces.component.UIComponent;
+import java.io.IOException;
+
+/**
+ * This provides an alternative ResponseWriter interfaces, which allows optimizations.
+ * E. g. some attributes needed to to be escaped.
+ *
+ * User: lofwyr
+ * Date: 08.05.2007 13:51:43
+ */
+public interface TobagoResponseWriter {
+
+ // same as in ResponseWriter
+
+ void startElement(String name, UIComponent component) throws IOException;
+
+ void endElement(String name) throws IOException;
+
+ // others (not from ResponseWriter)
+
+ /**
+ * Writes a string attribute. The renderer may set escape=false to switch of escaping of the string,
+ * if it is not necessary.
+ */
+ void writeAttribute(String name, String string, boolean escape) throws IOException;
+
+ /**
+ * Writes a boolean attribute. The value will not escaped.
+ */
+ void writeAttribute(String name, boolean on) throws IOException;
+
+ /**
+ * Writes a integer attribute. The value will not escaped.
+ */
+ void writeAttribute(String name, int number) throws IOException;
+
+ /**
+ * Write the id attribute. The value will not escaped.
+ */
+ void writeIdAttribute(String id) throws IOException;
+
+ /**
+ * Write the name attribute. The value will not escaped.
+ */
+ void writeNameAttribute(String name) throws IOException;
+
+ /**
+ * Write the class attribute. The value will not escaped.
+ */
+ void writeClassAttribute(String cssClass) throws IOException;
+
+ /**
+ * Write the class attribute. The value will not escaped.
+ */
+ void writeClassAttribute() throws IOException;
+
+ /**
+ * Write the style attribute. The value will not escaped.
+ */
+ void writeStyleAttribute(String style) throws IOException;
+
+ /**
+ * Write the style attribute. The value will not escaped.
+ */
+ void writeStyleAttribute() throws IOException;
+
+ void writeJavascript(String script) throws IOException;
+
+ void writeText(String text) throws IOException;
+}