1
|
|
#region Copyright
|
2
|
|
|
3
|
|
|
4
|
|
|
5
|
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
|
|
10
|
|
|
11
|
|
|
12
|
|
|
13
|
|
|
14
|
|
|
15
|
|
|
16
|
|
|
17
|
|
#endregion
|
18
|
|
|
19
|
|
using System;
|
20
|
|
using System.Collections;
|
21
|
|
using Seasar.Framework.Util;
|
22
|
|
|
23
|
|
namespace Seasar.Dao.Node
|
24
|
|
{
|
25
|
|
public abstract class AbstractNode : INode
|
26
|
|
{
|
27
|
|
private IList children = new ArrayList();
|
28
|
|
|
29
|
301
|
public AbstractNode()
|
30
|
|
{
|
31
|
|
}
|
32
|
|
|
33
|
|
#region INode メンバ
|
34
|
|
|
35
|
|
public int ChildSize
|
36
|
|
{
|
37
|
214
|
get
|
38
|
|
{
|
39
|
214
|
return children.Count;
|
40
|
|
}
|
41
|
|
}
|
42
|
|
|
43
|
142
|
public INode GetChild(int index)
|
44
|
|
{
|
45
|
142
|
return (INode) children[index];
|
46
|
|
}
|
47
|
|
|
48
|
223
|
public void AddChild(INode node)
|
49
|
|
{
|
50
|
223
|
children.Add(node);
|
51
|
|
}
|
52
|
|
|
53
|
0
|
public bool ContainsChild(Type childType)
|
54
|
|
{
|
55
|
|
foreach(INode child in children)
|
56
|
|
{
|
57
|
|
if(child.GetType().Equals(childType)) return true;
|
58
|
|
}
|
59
|
|
return false;
|
60
|
|
}
|
61
|
|
|
62
|
|
public abstract void Accept(ICommandContext ctx);
|
63
|
|
|
64
|
|
#endregion
|
65
|
|
|
66
|
28
|
protected object InvokeExpression(string expression, ICommandContext ctx)
|
67
|
|
{
|
68
|
28
|
Hashtable ht = new Hashtable();
|
69
|
28
|
ht["self"] = ctx;
|
70
|
28
|
ht["out"] = Console.Out;
|
71
|
28
|
ht["err"] = Console.Error;
|
72
|
28
|
return JScriptUtil.Evaluate(expression, ht, null);
|
73
|
|
}
|
74
|
|
}
|
75
|
|
}
|
76
|
|
|