Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.jexl2.introspection;
import org.apache.commons.jexl2.internal.Introspector;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.jexl2.JexlInfo;
import org.apache.commons.jexl2.JexlException;
import org.apache.commons.jexl2.internal.AbstractExecutor;
import org.apache.commons.jexl2.internal.ArrayIterator;
import org.apache.commons.jexl2.internal.EnumerationIterator;
import org.apache.commons.jexl2.internal.introspection.MethodKey;
import org.apache.commons.logging.Log;
/**
* Implementation of Uberspect to provide the default introspective
* functionality of JEXL.
*
This is the class to derive to customize introspection.
*
* @since 1.0
* @author Geir Magnusson Jr.
* @author Henning P. Schmiedehausen
* @version $Id: UberspectImpl.java 896952 2010-01-07 18:21:29Z henrib $
*/
public class UberspectImpl extends Introspector implements Uberspect {
/**
* Publicly exposed special failure object returned by tryInvoke.
*/
public static final Object TRY_FAILED = AbstractExecutor.TRY_FAILED;
/**
* Creates a new UberspectImpl.
* @param runtimeLogger the logger used for all logging needs
*/
public UberspectImpl(Log runtimeLogger) {
super(runtimeLogger);
}
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
public Iterator> getIterator(Object obj, JexlInfo info) {
if (obj instanceof Iterator>) {
return ((Iterator>) obj);
}
if (obj.getClass().isArray()) {
return new ArrayIterator(obj);
}
if (obj instanceof Map,?>) {
return ((Map,?>) obj).values().iterator();
}
if (obj instanceof Enumeration>) {
return new EnumerationIterator