*
* <p>Note: We use {@link #UNDEFINED} to denote undefined since 2.4.0,
* while null is a valid value.
*/
protected Object getFromNamespace(String name) {
final Scope scope = getCurrent();
if (scope != null) { //null means no scope allowed!
final Execution exec = Executions.getCurrent();
if (exec != null && exec != scope) {
Object val = exec.getAttribute(name);
if (val != null /*|| exec.hasAttribute(name)*/) //request's hasAttribute same as getAttribute
return val;
}
if (scope instanceof Component) {
Component comp = (Component)scope;
Object val = comp.getAttributeOrFellow(name, true);
if (val != null || comp.hasAttributeOrFellow(name, true))
return val;
Page page = comp.getPage();
if (page != null) {
val = page.getXelVariable(null, null, name, true);
if (val != null)
return val;
}
} else if (scope instanceof Page) {
Page page = (Page)scope;
Object val = page.getAttributeOrFellow(name, true);
if (val != null || page.hasAttributeOrFellow(name, true))
return val;
val = page.getXelVariable(null, null, name, true);
if (val != null)
return val;
} else {
Object val = scope.getAttribute(name, true);
if (val != null || scope.hasAttribute(name, true))
return val;
}
}
return getImplicit(name);
}