flex.messaging.io.amf.ActionMessageOutput Maven / Gradle / Ivy
/*
* 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 flex.messaging.io.amf;
import java.io.IOException;
import java.io.OutputStream;
import java.io.ObjectOutput;
/**
* Entry point for serializing an individual ActionMessage
* response message for AMF, AMFX or RTMP Channels.
*
* @author Peter Farland
*
* @see flex.messaging.io.amf.Amf0Input Classic Version 0 Deserializer
* @see flex.messaging.io.amf.Amf3Input AVM+ Version 3 Deserializer
*
* @see flex.messaging.io.amf.ActionMessageOutput The serialization equivalent
*/
public interface ActionMessageOutput extends ObjectOutput
{
// java.io.ObjectOutput METHODS
/**
* A convenient entry point for writing out any Object for conversion to ActionScript.
* The Java class type of the Object will determine the corresponding ActionScript type
* that will be specified in the AMF stream.
*
* The following is a guide to the Java to ActionScript type mappings:
*
* Java Type ActionScript Type (AMF 0) ActionScript Type (AMF 3 / AMFX)
* java.lang.String String String
* java.lang.Boolean Boolean Boolean
* java.lang.Integer
java.lang.Short
java.lang.Byte Number int(a)
* java.lang.Double
java.lang.Long
java.lang.Float Number Number
* java.util.Calendar
java.util.Date Date(b) Date(b)
* java.lang.Character
java.lang.Character[] String String
* java.lang.Byte[] Array (of Numbers) ByteArray
* java.util.Collection mx.collections.ArrayCollection(c) mx.collections.ArrayCollection(c)
* java.lang.Object[] (Native Array) Array Array
* java.util.Map
java.util.Dictionary Object(d) Object(d)
* java.lang.Object (Other than the above) Typed Object(e) Typed Object(e)
* null null null
*
*
*
* (a) - For AMF 3 ints, taking sign into consideration, if i < 0xF0000000 || i > 0x0FFFFFFF, then value is promoted to Number.
*
* (b) - Dates are sent in the UTC timezone. Clients and servers must adjust time accordingly for timezones.
*
* (c) - Channel serialization configuration can be set to support legacy Collection to ActionScript Array conversion.
*
* (d) - Channel serialization configuration can be set to support legacy Map to ActionScript Array (associative) conversion.
*
* (e) - Objects are serialized using Java Bean introspection rules. Fields that are static, transient or non-public are excluded.
*
*
* @param object the Object to be written
* @throws IOException if an I/O error occurs
*/
void writeObject(Object object) throws IOException;
/**
* Internal use only.
* @exclude
*/
void writeObjectTraits(TraitsInfo traits) throws IOException;
/**
* Internal use only.
* @exclude
*/
void writeObjectProperty(String name, Object value) throws IOException;
/**
* Internal use only.
* @exclude
*/
void writeObjectEnd() throws IOException;
//
// INITIALIZATION UTILITIES
//
/**
* Internal use only.
* @exclude
*/
void setDebugTrace(AmfTrace debugBuffer);
/**
* Internal use only.
* @exclude
*/
void setOutputStream(OutputStream out);
/**
* Internal use only.
* @exclude
*/
void reset();
}