01: package org.drools.util.asm;
02:
03: /*
04: * Copyright 2005 JBoss Inc
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: import java.io.Serializable;
20:
21: /**
22: * This provides "field" access to getters on a given class.
23: * Implementations are generated into byte code (using a switchtable)
24: * when a new class is encountered.
25: * @deprecated use ClassFieldExtractor instead
26: * @author Michael Neale
27: * @author "Jeff Brown" <brown_j@ociweb.com>
28: */
29: public interface FieldAccessor extends Serializable {
30:
31: /**
32: * Returns the "field" corresponding to the order in which it is in the object (class).
33: *
34: * @param obj The object for the field to be extracted from.
35: * @param idx The index of the "field". Refer to FieldAccessorMap to get the mapping
36: * of the names of the "fields" to the index value to use for fast lookup.
37: *
38: * @return Appropriate return type. Primitives are boxed to the corresponding type.
39: */
40: public Object getFieldByIndex(Object obj, int idx);
41:
42: }
|