01: package org.jicengine.element.impl;
02:
03: import org.jicengine.expression.SyntaxException;
04: import org.jicengine.operation.Context;
05: import org.jicengine.operation.Operation;
06:
07: import org.jicengine.element.*;
08:
09: import java.util.*;
10:
11: /**
12: *
13: *
14: * <p>
15: * Copyright (C) 2004 Timo Laitinen
16: * </p>
17: * @author Timo Laitinen
18: * @created 2004-09-20
19: * @since JICE-0.10
20: *
21: */
22:
23: public class ListElementCompiler extends CollectionElementCompiler {
24:
25: public ListElementCompiler(String name, Location location)
26: throws ElementException {
27: super (name, location);
28: }
29:
30: /*
31: public void elementInitialized() throws ElementException
32: {
33: super.elementInitialized();
34:
35: if( getConstructor() == null ){
36: setConstructor("new java.util.ArrayList()");
37: }
38: }
39: */
40:
41: public void setInstanceClass(String className)
42: throws ElementException {
43: super .setInstanceClass(className);
44:
45: if (!List.class.isAssignableFrom(getElement()
46: .getInstanceClass())) {
47: throw new ElementException("Class '"
48: + getElement().getInstanceClass().getName()
49: + "' is not a List.", getElement().getName(),
50: getLocation());
51: }
52: }
53: }
|