KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > google > gwt > user > server > rpc > impl > ServerSerializableTypeOracle


1 /*
2  * Copyright 2006 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  */

16 package com.google.gwt.user.server.rpc.impl;
17
18 import java.lang.reflect.Field JavaDoc;
19
20 /**
21  * This interface defines a serializable type oracle that can be used by the rpc
22  * servlet.
23  */

24 public interface ServerSerializableTypeOracle {
25
26   /**
27    * Given a set of fields for a given instance type, return an array of fields
28    * that represents the fields that can actually be serialized.
29    */

30   Field JavaDoc[] applyFieldSerializationPolicy(Field JavaDoc[] declaredFields);
31
32   /**
33    * Given an encoded serialized instance reference, return an object
34    * that can be queried for its component parts.
35    */

36   SerializedInstanceReference decodeSerializedInstanceReference(
37       String JavaDoc encodedSerializedInstanceReference);
38
39   /**
40    * Given an instance type generate an encoded string that represents the
41    * serialized instance.
42    */

43   String JavaDoc encodeSerializedInstanceReference(Class JavaDoc instanceType);
44
45   /**
46    * Get the serialization signature for a given instance type.
47    */

48   String JavaDoc getSerializationSignature(Class JavaDoc instanceType);
49
50   /**
51    * Get the serialized name of a type instance.
52    */

53   String JavaDoc getSerializedTypeName(Class JavaDoc instanceType);
54   
55   /**
56    * Return the class object for the custom field serializer for a given
57    * instance type.
58    *
59    * @param instanceType
60    * @return Class object for the custom field serializer for the instance type
61    * or null if there is no custom field serializer
62    */

63   Class JavaDoc hasCustomFieldSerializer(Class JavaDoc instanceType);
64   
65   /**
66    * Returns true if the instance type is serializable.
67    *
68    * @param instanceType
69    * @return true if the instance type is serializable
70    */

71   boolean isSerializable(Class JavaDoc instanceType);
72 }
73
Popular Tags