{
load();
}
Selector sel = m_metaclass.findSelector(sym.toString());
Member member = (sel == null) ? null : sel.findMember(nArgCount - 1);
if (member == null)
{
Object value = Undefined.VALUE;
if (nArgCount == 1)
{
value = findAnnotation(sym.toString(), Undefined.VALUE);
}
if (value == Undefined.VALUE)
{
// This should throw an exception
m_metaclass.getSelector(sym.toString()).getMember(nArgCount - 1);
}
machine.returnValue(value, nArgCount);
return false;
}
if (member.isAttribute())
{
if (nArgCount == 1)
{
machine.returnValue(
(member.isStatic()) ?
m_metaclass.getValue(((Attribute)member).getOrdinal()) :
getValue(((Attribute)member).getOrdinal()),
nArgCount);
}
else if (nArgCount == 2)
{
Object value = machine.getArg(1, nArgCount);
if (member.isStatic())
{
m_metaclass.setValue(((Attribute)member).getOrdinal(), value);
}
else
{
setValue(((Attribute)member).getOrdinal(), value);
}
machine.returnValue(value, nArgCount);
}
else
{
throw new ScriptingException("err.scripting.maxArgCount",
new Object[]{toString(),
Primitive.ONE_INTEGER,
Primitive.createInteger(nArgCount - 1)});
}
return false;
}
else
{
if (member.isStatic())
{
machine.setArg(0, nArgCount, m_metaclass);
}
else
{