1 /* 2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 package vm.runtime.defmeth.shared.data; 25 26 import vm.runtime.defmeth.shared.data.method.AbstractMethod; 27 import vm.runtime.defmeth.shared.data.method.ConcreteMethod; 28 import vm.runtime.defmeth.shared.data.method.DefaultMethod; 29 import vm.runtime.defmeth.shared.data.method.Method; 30 import vm.runtime.defmeth.shared.data.method.body.CallMethod; 31 import vm.runtime.defmeth.shared.data.method.body.EmptyBody; 32 import vm.runtime.defmeth.shared.data.method.body.ReturnIntBody; 33 import vm.runtime.defmeth.shared.data.method.body.ReturnNewInstanceBody; 34 import vm.runtime.defmeth.shared.data.method.body.ReturnNullBody; 35 import vm.runtime.defmeth.shared.data.method.body.ThrowExBody; 36 import vm.runtime.defmeth.shared.data.method.param.DoubleParam; 37 import vm.runtime.defmeth.shared.data.method.param.FloatParam; 38 import vm.runtime.defmeth.shared.data.method.param.IntParam; 39 import vm.runtime.defmeth.shared.data.method.param.LongParam; 40 import vm.runtime.defmeth.shared.data.method.param.NewInstanceParam; 41 import vm.runtime.defmeth.shared.data.method.param.StringParam; 42 import vm.runtime.defmeth.shared.data.method.result.IntResult; 43 import vm.runtime.defmeth.shared.data.method.result.ThrowExResult; 44 45 /** 46 * {@code AbstactVisitor} provides implementation for all methods from {@code Visitor}, 47 * which throws {@code UnsupportedOperationException}. It is useful 48 * for custom visitors, which expect only a subset of events to occur. 49 */ 50 public class AbstractVisitor implements Visitor { 51 @Override 52 public void visitClass(Clazz clz) { 53 throw new UnsupportedOperationException(); 54 } 55 56 @Override 57 public void visitConcreteClass(ConcreteClass clz) { 58 throw new UnsupportedOperationException(); 59 } 60 61 @Override 62 public void visitInterface(Interface intf) { 63 throw new UnsupportedOperationException(); 64 } 65 66 @Override 67 public void visitMethod(Method m) { 68 throw new UnsupportedOperationException(); 69 } 70 71 @Override 72 public void visitConcreteMethod(ConcreteMethod m) { 73 throw new UnsupportedOperationException(); 74 } 75 76 @Override 77 public void visitAbstractMethod(AbstractMethod m) { 78 throw new UnsupportedOperationException(); 79 } 80 81 @Override 82 public void visitDefaultMethod(DefaultMethod m) { 83 throw new UnsupportedOperationException(); 84 } 85 86 @Override 87 public void visitTester(Tester t) { 88 throw new UnsupportedOperationException(); 89 } 90 91 @Override 92 public void visitThrowExBody(ThrowExBody body) { 93 throw new UnsupportedOperationException(); 94 } 95 96 @Override 97 public void visitReturnIntBody(ReturnIntBody body) { 98 throw new UnsupportedOperationException(); 99 } 100 101 @Override 102 public void visitReturnNullBody(ReturnNullBody body) { 103 throw new UnsupportedOperationException(); 104 } 105 106 @Override 107 public void visitEmptyBody(EmptyBody body) { 108 throw new UnsupportedOperationException(); 109 } 110 111 @Override 112 public void visitCallMethod(CallMethod call) { 113 throw new UnsupportedOperationException(); 114 } 115 116 @Override 117 public void visitReturnNewInstanceBody(ReturnNewInstanceBody body) { 118 throw new UnsupportedOperationException(); 119 } 120 121 @Override 122 public void visitResultInt(IntResult res) { 123 throw new UnsupportedOperationException(); 124 } 125 126 @Override 127 public void visitResultThrowExc(ThrowExResult res) { 128 throw new UnsupportedOperationException(); 129 } 130 131 @Override 132 public void visitResultIgnore() { 133 throw new UnsupportedOperationException(); 134 } 135 136 @Override 137 public void visitParamInt(IntParam i) { 138 throw new UnsupportedOperationException(); 139 } 140 141 @Override 142 public void visitParamLong(LongParam l) { 143 throw new UnsupportedOperationException(); 144 } 145 146 @Override 147 public void visitParamFloat(FloatParam f) { 148 throw new UnsupportedOperationException(); 149 } 150 151 @Override 152 public void visitParamDouble(DoubleParam d) { 153 throw new UnsupportedOperationException(); 154 } 155 156 @Override 157 public void visitParamString(StringParam str) { 158 throw new UnsupportedOperationException(); 159 } 160 161 @Override 162 public void visitParamNewInstance(NewInstanceParam type) { 163 throw new UnsupportedOperationException(); 164 } 165 166 @Override 167 public void visitParamNull() { 168 throw new UnsupportedOperationException(); 169 } 170 }