001/** 002 * GRANITE DATA SERVICES 003 * Copyright (C) 2006-2013 GRANITE DATA SERVICES S.A.S. 004 * 005 * This file is part of the Granite Data Services Platform. 006 * 007 * Granite Data Services is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * Granite Data Services is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 015 * General Public License for more details. 016 * 017 * You should have received a copy of the GNU Lesser General Public 018 * License along with this library; if not, write to the Free Software 019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 020 * USA, or see <http://www.gnu.org/licenses/>. 021 */ 022package org.granite.messaging.reflect; 023 024import java.lang.annotation.Annotation; 025import java.lang.reflect.InvocationTargetException; 026 027public class NullProperty implements Property { 028 029 public Class<?> getType() { 030 throw new UnsupportedOperationException(); 031 } 032 033 public String getName() { 034 throw new UnsupportedOperationException(); 035 } 036 037 public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) { 038 throw new UnsupportedOperationException(); 039 } 040 041 public boolean isReadable() { 042 throw new UnsupportedOperationException(); 043 } 044 045 public boolean isWritable() { 046 throw new UnsupportedOperationException(); 047 } 048 049 public boolean getBoolean(Object holder) 050 throws IllegalArgumentException, IllegalAccessException, 051 InvocationTargetException { 052 throw new UnsupportedOperationException(); 053 } 054 055 public char getChar(Object holder) throws IllegalArgumentException, 056 IllegalAccessException, InvocationTargetException { 057 throw new UnsupportedOperationException(); 058 } 059 060 public byte getByte(Object holder) throws IllegalArgumentException, 061 IllegalAccessException, InvocationTargetException { 062 throw new UnsupportedOperationException(); 063 } 064 065 public short getShort(Object holder) throws IllegalArgumentException, 066 IllegalAccessException, InvocationTargetException { 067 throw new UnsupportedOperationException(); 068 } 069 070 public int getInt(Object holder) throws IllegalArgumentException, 071 IllegalAccessException, InvocationTargetException { 072 throw new UnsupportedOperationException(); 073 } 074 075 public long getLong(Object holder) throws IllegalArgumentException, 076 IllegalAccessException, InvocationTargetException { 077 throw new UnsupportedOperationException(); 078 } 079 080 public float getFloat(Object holder) throws IllegalArgumentException, 081 IllegalAccessException, InvocationTargetException { 082 throw new UnsupportedOperationException(); 083 } 084 085 public double getDouble(Object holder) throws IllegalArgumentException, 086 IllegalAccessException, InvocationTargetException { 087 throw new UnsupportedOperationException(); 088 } 089 090 public Object getObject(Object holder) throws IllegalArgumentException, 091 IllegalAccessException, InvocationTargetException { 092 throw new UnsupportedOperationException(); 093 } 094 095 public Object getRawObject(Object holder) throws IllegalArgumentException, 096 IllegalAccessException, InvocationTargetException { 097 throw new UnsupportedOperationException(); 098 } 099 100 public void setBoolean(Object holder, boolean value) 101 throws IllegalArgumentException, IllegalAccessException, 102 InvocationTargetException { 103 throw new UnsupportedOperationException(); 104 } 105 106 public void setChar(Object holder, char value) 107 throws IllegalArgumentException, IllegalAccessException, 108 InvocationTargetException { 109 throw new UnsupportedOperationException(); 110 } 111 112 public void setByte(Object holder, byte value) 113 throws IllegalArgumentException, IllegalAccessException, 114 InvocationTargetException { 115 throw new UnsupportedOperationException(); 116 } 117 118 public void setShort(Object holder, short value) 119 throws IllegalArgumentException, IllegalAccessException, 120 InvocationTargetException { 121 throw new UnsupportedOperationException(); 122 } 123 124 public void setInt(Object holder, int value) 125 throws IllegalArgumentException, IllegalAccessException, 126 InvocationTargetException { 127 throw new UnsupportedOperationException(); 128 } 129 130 public void setLong(Object holder, long value) 131 throws IllegalArgumentException, IllegalAccessException, 132 InvocationTargetException { 133 throw new UnsupportedOperationException(); 134 } 135 136 public void setFloat(Object holder, float value) 137 throws IllegalArgumentException, IllegalAccessException, 138 InvocationTargetException { 139 throw new UnsupportedOperationException(); 140 } 141 142 public void setDouble(Object holder, double value) 143 throws IllegalArgumentException, IllegalAccessException, 144 InvocationTargetException { 145 throw new UnsupportedOperationException(); 146 } 147 148 public void setObject(Object holder, Object value) 149 throws IllegalArgumentException, IllegalAccessException, 150 InvocationTargetException { 151 throw new UnsupportedOperationException(); 152 } 153 154 @Override 155 public int hashCode() { 156 return 0; 157 } 158 159 @Override 160 public boolean equals(Object obj) { 161 return obj == this; 162 } 163 164 @Override 165 public String toString() { 166 return NullProperty.class.getSimpleName(); 167 } 168}