001 /* 002 * Copyright 2003-2004 The Apache Software Foundation. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017 package org.apache.commons.mapper; 018 019 import java.util.Collection; 020 021 /** 022 * A default implementation of the Mapper interface that throws 023 * <code>UnsupportedOperationExceptions</code> for all methods. This 024 * makes it easy to define an anonymous inner class Mapper implementation. 025 */ 026 public class MapperAdapter implements Mapper { 027 028 /** 029 * Default constructor for MapperAdapter. 030 */ 031 public MapperAdapter() { 032 super(); 033 } 034 035 /** 036 * @see org.apache.commons.mapper.Mapper#create(java.lang.Object) 037 */ 038 public Object create(Object object) throws MapperException { 039 throw new UnsupportedOperationException("create() not supported."); 040 } 041 042 /** 043 * @see org.apache.commons.mapper.Mapper#findByUniqueId(java.lang.Object) 044 */ 045 public Object findByUniqueId(Object id) throws MapperException { 046 throw new UnsupportedOperationException("findByUniqueId() not supported ."); 047 } 048 049 /** 050 * @see org.apache.commons.mapper.Mapper#delete(java.lang.Object) 051 */ 052 public void delete(Object object) throws MapperException { 053 throw new UnsupportedOperationException("delete() not supported."); 054 055 } 056 057 /** 058 * @see org.apache.commons.mapper.Mapper#update(java.lang.Object) 059 */ 060 public void update(Object object) throws MapperException { 061 throw new UnsupportedOperationException("update() not supported."); 062 063 } 064 065 /** 066 * @see org.apache.commons.mapper.Mapper#findAllObjects() 067 */ 068 public Collection findAllObjects() throws MapperException { 069 throw new UnsupportedOperationException("findAllObjects() not supported."); 070 } 071 072 }