org.ajax4jsf.framework.ajax.xmlfilter.XMLResponseWriterState Maven / Gradle / Ivy
/**
* Licensed under the Common Development and Distribution License,
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.sun.com/cddl/
*
* 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.ajax4jsf.framework.ajax.xmlfilter;
import java.io.IOException;
import javax.faces.component.UIComponent;
import org.ajax4jsf.framework.util.message.Messages;
/**
* @author shura Class to implement state pattern for
* ResponceWriter
Real states must extend this. By
* default, block any events, ignore output.
*
*/
class XMLResponseWriterState {
// private ResponseWriter writer;
/**
* @throws java.io.IOException
*/
private static String ILLEGAL_METOD_STATE = Messages.getMessage(Messages.ILLEGAL_METHOD_STATE);
void endDocument() throws IOException {
throw new IOException(ILLEGAL_METOD_STATE);
}
/**
* @param name
* @throws java.io.IOException
*/
void endElement(String name) throws IOException {
throw new IOException(ILLEGAL_METOD_STATE);
}
/**
* @throws java.io.IOException
*/
void startDocument() throws IOException {
throw new IOException(ILLEGAL_METOD_STATE);
}
/**
* @param name
* @param component
* @throws java.io.IOException
*/
void startElement(String name, UIComponent component) throws IOException {
throw new IOException(ILLEGAL_METOD_STATE);
}
/**
* @param name
* @param value
* @param property
* @throws java.io.IOException
*/
void writeAttribute(String name, Object value, String property)
throws IOException {
throw new IOException(ILLEGAL_METOD_STATE);
}
/**
* @param comment
* @throws java.io.IOException
*/
void writeComment(Object comment) throws IOException {
throw new IOException(ILLEGAL_METOD_STATE);
}
/**
* @param text
* @param off
* @param len
* @throws java.io.IOException
*/
void writeText(char[] text, int off, int len) throws IOException {
throw new IOException(ILLEGAL_METOD_STATE);
}
/**
* @param text
* @param property
* @throws java.io.IOException
*/
void writeText(Object text, String property) throws IOException {
throw new IOException(ILLEGAL_METOD_STATE);
}
/**
* @param name
* @param value
* @param property
* @throws java.io.IOException
*/
void writeURIAttribute(String name, Object value, String property)
throws IOException {
throw new IOException(ILLEGAL_METOD_STATE);
}
/**
*
* Main hook for realise Writer
. In document writed as
* comment, outside of document do nothing ....
*
* @param cbuf
* @param off
* @param len
* @throws IOException
*/
void write(char[] cbuf, int off, int len) throws IOException {
// DO NOTHING
}
}