001 /* 002 * Copyright 2005 Stephen J. McConnell. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 013 * implied. 014 * 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018 019 package net.dpml.lang; 020 021 import java.util.Map; 022 023 /** 024 * A object resolvable from primitive and symbolic arguments. 025 * 026 * @author <a href="http://www.dpml.net">Digital Product Meta Library</a> 027 * @version 1.0.3 028 */ 029 public interface Value 030 { 031 /** 032 * Resolve an instance from the value using the context classloader. 033 * @return the resolved instance 034 * @exception Exception if error occurs during instance resolution 035 */ 036 Object resolve() throws Exception; 037 038 /** 039 * Resolve an instance from the value using a supplied context map. If any 040 * target expressions in immediate or nested values contain a symbolic 041 * expression the value will be resolved using the supplied map. 042 * 043 * @param map the context map 044 * @return the resolved instance 045 * @exception Exception if error occurs during instance resolution 046 */ 047 Object resolve( Map map ) throws Exception; 048 049 /** 050 * Resolve an instance from the value using a supplied isolation policy. 051 * 052 * @param isolate the isolation policy 053 * @return the resolved instance 054 * @exception Exception if error occurs during instance resolution 055 */ 056 Object resolve( boolean isolate ) throws Exception; 057 058 /** 059 * Resolve an instance from the value using a supplied context map. If any 060 * target expressions in immediate or nested values contain a symbolic 061 * expression the value will be resolved using the supplied map. 062 * 063 * @param map the context map 064 * @param isolate the isolation policy 065 * @return the resolved instance 066 * @exception Exception if error occurs during instance resolution 067 */ 068 Object resolve( Map map, boolean isolate ) throws Exception; 069 070 /** 071 * Resolve an instance from the value using a supplied context map. If any 072 * target expressions in immediate or nested values contain a symbolic 073 * expression the value will be resolved using the supplied map. 074 * 075 * @param classname the default classname 076 * @param map the context map 077 * @param isolate the isolation policy 078 * @return the resolved instance 079 * @exception Exception if error occurs during instance resolution 080 */ 081 Object resolve( String classname, Map map, boolean isolate ) throws Exception; 082 083 }