/** Invokes {@link ScopeListener#attributeAdded} for registered * listeners. * * @see #addScopeListener */ public void notifyAdded(String name, Object value) { if (_listeners != null) for (ScopeListener l : _listeners) l.attributeAdded(_owner, name, value); }
/** Invokes {@link ScopeListener#attributeReplaced} for registered * listeners. * * @see #addScopeListener */ public void notifyReplaced(String name, Object value) { if (_listeners != null) for (ScopeListener l : _listeners) l.attributeReplaced(_owner, name, value); }
/** Invokes {@link ScopeListener#attributeRemoved} for registered * listeners. * * @see #addScopeListener */ public void notifyRemoved(String name) { if (_listeners != null) for (ScopeListener l : _listeners) l.attributeRemoved(_owner, name); }
public boolean equals(Object o) { if (this == o) return true; return _scope.getAttributes() .equals(o instanceof DeferredAttributes ? ((DeferredAttributes) o)._scope.getAttributes() : o); }
private void restoreStatus() { final Scope scope = getScope(); if (_status.previous != null) scope.setAttribute("forEachStatus", _status.previous); else scope.removeAttribute("forEachStatus"); if (_oldEach != null) scope.setAttribute("each", _oldEach); else scope.removeAttribute("each"); _it = null; _status = null; //recycle (just in case) }
/** Invokes {@link ScopeListener#parentChanged} for registered * listeners. * * @see #addScopeListener */ public void notifyParentChanged(Scope newparent) { if (_listeners != null) for (ScopeListener l : _listeners) l.parentChanged(_owner, newparent); }
/** Invokes {@link ScopeListener#idSpaceChanged} for registered * listeners. * * @see #addScopeListener * @since 5.0.1 */ public void notifyIdSpaceChanged(IdSpace newIdSpace) { if (_listeners != null) for (ScopeListener l : _listeners) l.idSpaceChanged(_owner, newIdSpace); } }
/** Returns the value of the implicit variables. * It is called by {@link #getFromNamespace}, so you don't need to * invoke this method if you invoke {@link #getFromNamespace}. * However, you have to invoke this method as the last step, if you * implement your own getFromNamespace from scratch. * @since 3.6.0 */ protected static Object getImplicit(String name) { return Scopes.getImplicit(name, UNDEFINED); }
public final void setOwner(Component comp) { if (_owner != null) throw new IllegalStateException("owner can be set only once"); _owner = comp; if (_owner instanceof Includer) ((Includer) _owner).setChildPage(this); }
private Object getImplicit(String name, Object defValue) { Object val = _vars.get(name); if (val != null || _vars.containsKey(name)) { if (val instanceof Deferred) _vars.put(name, val = ((Deferred) val).getValue()); return val; } val = getSysImplicit(name); return val != null ? val : defValue; } }
public Component newInstance(Page page, Component parent) { final Component comp = super.newInstance(page, parent); if (_dns != null) { final Native nc = (Native) comp; for (Namespace ns : _dns) nc.addDeclaredNamespace(ns); } return comp; } }
private static Object getSysImplicit(String name) { final Object val = getCurrent(null); return val instanceof Component ? Components.getImplicit((Component) val, name) : val instanceof Page ? Components.getImplicit((Page) val, name) : null; }
public void clear() { _scope.getAttributes().clear(); }
public String toString() { return _scope.getAttributes().toString(); } }
public boolean isEmpty() { return _scope.getAttributes().isEmpty(); }
public Set<String> keySet() { return _scope.getAttributes().keySet(); }
public Collection<Object> values() { return _scope.getAttributes().values(); }
public boolean containsValue(Object arg0) { return _scope.getAttributes().containsValue(arg0); }
public Object get(Object arg0) { return _scope.getAttributes().get(arg0); }
public int size() { return _scope.getAttributes().size(); }