--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.catalog.types.MethodAliasInfo\r
+\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.catalog.types;\r
+\r
+import org.apache.derby.iapi.services.io.Formatable;\r
+import org.apache.derby.iapi.services.io.StoredFormatIds;\r
+import org.apache.derby.iapi.reference.SQLState;\r
+import org.apache.derby.catalog.AliasInfo;\r
+import java.io.IOException;\r
+import java.io.ObjectInput;\r
+import java.io.ObjectOutput;\r
+\r
+/**\r
+ * Describe a method alias.\r
+ *\r
+ * @see AliasInfo\r
+ */\r
+public class MethodAliasInfo\r
+implements AliasInfo, Formatable\r
+{\r
+ /********************************************************\r
+ **\r
+ ** This class implements Formatable. That means that it\r
+ ** can write itself to and from a formatted stream. If\r
+ ** you add more fields to this class, make sure that you\r
+ ** also write/read them with the writeExternal()/readExternal()\r
+ ** methods.\r
+ **\r
+ ** If, inbetween releases, you add more fields to this class,\r
+ ** then you should bump the version number emitted by the getTypeFormatId()\r
+ ** method.\r
+ **\r
+ ********************************************************/\r
+\r
+ private String methodName;\r
+\r
+ /**\r
+ * Public niladic constructor. Needed for Formatable interface to work.\r
+ */\r
+ public MethodAliasInfo() {}\r
+\r
+ /**\r
+ * Create a MethodAliasInfo\r
+ *\r
+ * @param methodName The name of the method for the alias.\r
+ */\r
+ public MethodAliasInfo(String methodName)\r
+ {\r
+ this.methodName = methodName;\r
+ }\r
+\r
+ // Formatable methods\r
+\r
+ /**\r
+ * Read this object from a stream of stored objects.\r
+ *\r
+ * @param in read this.\r
+ *\r
+ * @exception IOException thrown on error\r
+ * @exception ClassNotFoundException thrown on error\r
+ */\r
+ public void readExternal( ObjectInput in )\r
+ throws IOException, ClassNotFoundException\r
+ {\r
+ methodName = (String)in.readObject();\r
+ }\r
+\r
+ /**\r
+ * Write this object to a stream of stored objects.\r
+ *\r
+ * @param out write bytes here.\r
+ *\r
+ * @exception IOException thrown on error\r
+ */\r
+ public void writeExternal( ObjectOutput out )\r
+ throws IOException\r
+ {\r
+ out.writeObject( methodName );\r
+ }\r
+ \r
+ /**\r
+ * Get the formatID which corresponds to this class.\r
+ *\r
+ * @return the formatID of this class\r
+ */\r
+ public int getTypeFormatId() { return StoredFormatIds.METHOD_ALIAS_INFO_V01_ID; }\r
+\r
+ // \r
+ // AliasInfo methods\r
+ // \r
+ /**\r
+ @see org.apache.derby.catalog.AliasInfo#getMethodName\r
+ */\r
+ public String getMethodName()\r
+ {\r
+ return methodName;\r
+ }\r
+\r
+ /**\r
+ @see java.lang.Object#toString\r
+ */\r
+ public String toString()\r
+ {\r
+ return methodName;\r
+ }\r
+}\r