KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jicengine > element > impl > ListElementCompiler


1 package org.jicengine.element.impl;
2
3 import org.jicengine.expression.SyntaxException;
4 import org.jicengine.operation.Context;
5 import org.jicengine.operation.Operation;
6
7 import org.jicengine.element.*;
8
9 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 JavaDoc name, Location location) throws ElementException
26     {
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 JavaDoc className) throws ElementException
42   {
43     super.setInstanceClass(className);
44     
45     if( !List.class.isAssignableFrom(getElement().getInstanceClass())){
46       throw new ElementException("Class '" + getElement().getInstanceClass().getName() + "' is not a List.",getElement().getName(), getLocation());
47     }
48   }
49 }
50
Popular Tags