1 18 19 package org.objectweb.kilim.model; 20 21 import java.util.Stack ; 22 23 import org.objectweb.kilim.KilimException; 24 25 31 public class RtExternalValue extends RtComponentSource { 32 private String name; 33 private Object value; 34 35 40 public RtExternalValue(String aName, Object aValue) { 41 super(null, null); 42 name = aName; 43 value = aValue; 44 } 45 46 49 public String getLocalName() { 50 return name; 51 } 52 53 56 public Object getValue() throws KilimException { 57 Object resultValue = null; 58 if (mappingContext != null) { 59 mappingContext.getCallStack().push(this); 60 } 61 mapper.enterContext(mappingContext); 62 resultValue = mapper.getExternalValue(value, mappingContext); 63 64 if (mappingContext != null) { 65 mappingContext.getCallStack().pop(); 66 } 67 mapper.leaveContext(mappingContext); 68 return resultValue; 69 } 70 71 74 public boolean isEventSource() { 75 return false; 76 } 77 78 81 public Object getEventSourceValue() throws KilimException { 82 throw new KilimException("attempt to get the event source of element "); 83 } 84 85 88 public void setEventSourceValue(Object aSource) throws KilimException { 89 throw new KilimException("attempt to set the event source to a element "); 90 } 91 92 95 public boolean hasValue() throws KilimException { 96 return true; 97 } 98 99 102 public boolean checkValue(Stack exclude) throws KilimException { 103 return true; 104 } 105 } | Popular Tags |