Package webit.script.resolvers.impl

Source Code of webit.script.resolvers.impl.ScriptUnsetableBagResolver

// Copyright (c) 2013-2014, Webit Team. All Rights Reserved.
package webit.script.resolvers.impl;

import webit.script.exceptions.ScriptRuntimeException;
import webit.script.lang.SimpleUnsetableBag;
import webit.script.resolvers.GetResolver;
import webit.script.resolvers.SetResolver;

/**
*
* @author zqq90
* @since 1.4.0
*/
public class ScriptUnsetableBagResolver implements GetResolver, SetResolver {

    @SuppressWarnings("unchecked")
    public Object get(Object object, Object property) {
        return ((SimpleUnsetableBag) object).get(property);
    }

    public void set(Object object, Object property, Object value) {
        throw new ScriptRuntimeException("This is an unsetable Object.s");
    }

    public Class getMatchClass() {
        return SimpleUnsetableBag.class;
    }
}
TOP

Related Classes of webit.script.resolvers.impl.ScriptUnsetableBagResolver

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.