File | Line |
---|
org/apache/myfaces/application/jsp/JspStateManagerImpl.java | 672 |
org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementHelper.java | 165 |
}
protected void saveSerializedViewInServletSession(FacesContext context,
Object serializedView)
{
Map<String, Object> sessionMap = context.getExternalContext().getSessionMap();
SerializedViewCollection viewCollection = (SerializedViewCollection) sessionMap
.get(SERIALIZED_VIEW_SESSION_ATTR);
if (viewCollection == null)
{
viewCollection = new SerializedViewCollection();
sessionMap.put(SERIALIZED_VIEW_SESSION_ATTR, viewCollection);
}
viewCollection.add(context, serializeView(context, serializedView));
// replace the value to notify the container about the change
sessionMap.put(SERIALIZED_VIEW_SESSION_ATTR, viewCollection);
}
protected Object getSerializedViewFromServletSession(FacesContext context, String viewId, Integer sequence)
{
ExternalContext externalContext = context.getExternalContext();
Map<String, Object> requestMap = externalContext.getRequestMap();
Object serializedView = null;
if (requestMap.containsKey(RESTORED_SERIALIZED_VIEW_REQUEST_ATTR))
{
serializedView = requestMap.get(RESTORED_SERIALIZED_VIEW_REQUEST_ATTR);
}
else
{
SerializedViewCollection viewCollection = (SerializedViewCollection) externalContext
.getSessionMap().get(SERIALIZED_VIEW_SESSION_ATTR);
if (viewCollection != null)
{
/*
String sequenceStr = externalContext.getRequestParameterMap().get(
RendererUtils.SEQUENCE_PARAM);
Integer sequence = null;
if (sequenceStr == null)
{
// use latest sequence
Map map = externalContext.getSessionMap();
sequence = (Integer) map.get(RendererUtils.SEQUENCE_PARAM);
}
else
{
sequence = new Integer(sequenceStr);
}
*/
if (sequence != null)
{
Object state = viewCollection.get(sequence, viewId);
if (state != null)
{
serializedView = deserializeView(state);
}
}
}
requestMap.put(RESTORED_SERIALIZED_VIEW_REQUEST_ATTR, serializedView);
nextViewSequence(context);
}
return serializedView;
}
protected int getNextViewSequence(FacesContext context)
{
ExternalContext externalContext = context.getExternalContext();
if (!externalContext.getRequestMap().containsKey(RendererUtils.SEQUENCE_PARAM))
{
nextViewSequence(context);
}
Integer sequence = (Integer) externalContext.getRequestMap().get(RendererUtils.SEQUENCE_PARAM);
return sequence.intValue();
}
protected void nextViewSequence(FacesContext facescontext)
{
ExternalContext externalContext = facescontext.getExternalContext();
Object sessionObj = externalContext.getSession(true);
synchronized(sessionObj) // synchronized to increase sequence if multiple requests
// are handled at the same time for the session
{
Map<String, Object> map = externalContext.getSessionMap();
Integer sequence = (Integer) map.get(RendererUtils.SEQUENCE_PARAM);
if(sequence == null || sequence.intValue() == Integer.MAX_VALUE)
{
sequence = Integer.valueOf(1);
}
else
{
sequence = Integer.valueOf(sequence.intValue() + 1);
}
map.put(RendererUtils.SEQUENCE_PARAM, sequence);
externalContext.getRequestMap().put(RendererUtils.SEQUENCE_PARAM, sequence);
}
}
protected Object serializeView(FacesContext context, Object serializedView)
{
if (log.isLoggable(Level.FINEST)) log.finest("Entering serializeView");
if(isSerializeStateInSession(context))
{
if (log.isLoggable(Level.FINEST)) log.finest("Processing serializeView - serialize state in session");
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
try
{
OutputStream os = baos;
if(isCompressStateInSession(context))
{
if (log.isLoggable(Level.FINEST)) log.finest("Processing serializeView - serialize compressed");
os.write(COMPRESSED_FLAG);
os = new GZIPOutputStream(os, 1024);
}
else
{
if (log.isLoggable(Level.FINEST)) log.finest("Processing serializeView - serialize uncompressed");
os.write(UNCOMPRESSED_FLAG);
}
Object[] stateArray = (Object[]) serializedView;
ObjectOutputStream out = new ObjectOutputStream(os);
out.writeObject(stateArray[0]);
out.writeObject(stateArray[1]);
out.close();
baos.close();
if (log.isLoggable(Level.FINEST)) log.finest("Exiting serializeView - serialized. Bytes : "+baos.size());
return baos.toByteArray();
}
catch (IOException e)
{
log.log(Level.SEVERE, "Exiting serializeView - Could not serialize state: " + e.getMessage(), e);
return null;
}
}
if (log.isLoggable(Level.FINEST))
log.finest("Exiting serializeView - do not serialize state in session.");
return serializedView;
}
/**
* Reads the value of the <code>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</code> context parameter.
* @see SERIALIZE_STATE_IN_SESSION_PARAM
* @param context <code>FacesContext</code> for the request we are processing.
* @return boolean true, if the server state should be serialized in the session
*/
protected boolean isSerializeStateInSession(FacesContext context)
{
String value = context.getExternalContext().getInitParameter(
SERIALIZE_STATE_IN_SESSION_PARAM);
boolean serialize = DEFAULT_SERIALIZE_STATE_IN_SESSION;
if (value != null)
{
serialize = Boolean.valueOf(value);
}
return serialize;
}
/**
* Reads the value of the <code>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</code> context parameter.
* @see COMPRESS_SERVER_STATE_PARAM
* @param context <code>FacesContext</code> for the request we are processing.
* @return boolean true, if the server state steam should be compressed
*/
protected boolean isCompressStateInSession(FacesContext context)
{
String value = context.getExternalContext().getInitParameter(
COMPRESS_SERVER_STATE_PARAM);
boolean compress = DEFAULT_COMPRESS_SERVER_STATE_PARAM;
if (value != null)
{
compress = Boolean.valueOf(value);
}
return compress;
}
protected Object deserializeView(Object state)
{
if (log.isLoggable(Level.FINEST)) log.finest("Entering deserializeView");
if(state instanceof byte[])
{
if (log.isLoggable(Level.FINEST)) log.finest("Processing deserializeView - deserializing serialized state. Bytes : "+((byte[]) state).length);
try
{
ByteArrayInputStream bais = new ByteArrayInputStream((byte[]) state);
InputStream is = bais;
if(is.read() == COMPRESSED_FLAG)
{
is = new GZIPInputStream(is);
}
ObjectInputStream ois = null;
try
{
final ObjectInputStream in = new MyFacesObjectInputStream(is);
ois = in;
Object object = null;
if (System.getSecurityManager() != null)
{
object = AccessController.doPrivileged(new PrivilegedExceptionAction<Object []>()
{
public Object[] run() throws PrivilegedActionException, IOException, ClassNotFoundException
{
return new Object[] {in.readObject(), in.readObject()};
}
});
}
else
{
object = new Object[] {in.readObject(), in.readObject()};
}
return object;
}
finally
{
if (ois != null)
{
ois.close();
ois = null;
}
}
}
catch (PrivilegedActionException e)
{
log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
return null;
}
catch (IOException e)
{
log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
return null;
}
catch (ClassNotFoundException e)
{
log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
return null;
}
}
else if (state instanceof Object[])
{
if (log.isLoggable(Level.FINEST)) log.finest("Exiting deserializeView - state not serialized.");
return state;
}
else if(state == null)
{
log.severe("Exiting deserializeView - this method should not be called with a null-state.");
return null;
}
else
{
log.severe("Exiting deserializeView - this method should not be called with a state of type : "+state.getClass());
return null;
}
} |
File | Line |
---|
org/apache/myfaces/application/jsp/JspStateManagerImpl.java | 952 |
org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementHelper.java | 430 |
}
protected static class SerializedViewCollection implements Serializable
{
private static final long serialVersionUID = -3734849062185115847L;
private final List<Object> _keys = new ArrayList<Object>(DEFAULT_NUMBER_OF_VIEWS_IN_SESSION);
private final Map<Object, Object> _serializedViews = new HashMap<Object, Object>();
// old views will be hold as soft references which will be removed by
// the garbage collector if free memory is low
private transient Map<Object, Object> _oldSerializedViews = null;
public synchronized void add(FacesContext context, Object state)
{
Object key = new SerializedViewKey(context);
_serializedViews.put(key, state);
while (_keys.remove(key));
_keys.add(key);
int views = getNumberOfViewsInSession(context);
while (_keys.size() > views)
{
key = _keys.remove(0);
Object oldView = _serializedViews.remove(key);
if (oldView != null &&
!CACHE_OLD_VIEWS_IN_SESSION_MODE_OFF.equals(getCacheOldViewsInSessionMode(context)))
{
getOldSerializedViewsMap().put(key, oldView);
}
}
}
/**
* Reads the amount (default = 20) of views to be stored in session.
* @see NUMBER_OF_VIEWS_IN_SESSION_PARAM
* @param context FacesContext for the current request, we are processing
* @return Number vf views stored in the session
*/
protected int getNumberOfViewsInSession(FacesContext context)
{
String value = context.getExternalContext().getInitParameter(
NUMBER_OF_VIEWS_IN_SESSION_PARAM);
int views = DEFAULT_NUMBER_OF_VIEWS_IN_SESSION;
if (value != null)
{
try
{
views = Integer.parseInt(value);
if (views <= 0)
{
log.severe("Configured value for " + NUMBER_OF_VIEWS_IN_SESSION_PARAM
+ " is not valid, must be an value > 0, using default value ("
+ DEFAULT_NUMBER_OF_VIEWS_IN_SESSION);
views = DEFAULT_NUMBER_OF_VIEWS_IN_SESSION;
}
}
catch (Throwable e)
{
log.log(Level.SEVERE, "Error determining the value for " + NUMBER_OF_VIEWS_IN_SESSION_PARAM
+ ", expected an integer value > 0, using default value ("
+ DEFAULT_NUMBER_OF_VIEWS_IN_SESSION + "): " + e.getMessage(), e);
}
}
return views;
}
/**
* @return old serialized views map
*/
@SuppressWarnings("unchecked")
protected Map<Object, Object> getOldSerializedViewsMap()
{
FacesContext context = FacesContext.getCurrentInstance();
if (_oldSerializedViews == null && context != null)
{
String cacheMode = getCacheOldViewsInSessionMode(context);
if (CACHE_OLD_VIEWS_IN_SESSION_MODE_WEAK.equals(cacheMode))
{
_oldSerializedViews = new ReferenceMap(AbstractReferenceMap.WEAK, AbstractReferenceMap.WEAK, true);
}
else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT_WEAK.equals(cacheMode))
{
_oldSerializedViews = new ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.WEAK, true);
}
else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT.equals(cacheMode))
{
_oldSerializedViews = new ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.SOFT, true);
}
else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_HARD_SOFT.equals(cacheMode))
{
_oldSerializedViews = new ReferenceMap(AbstractReferenceMap.HARD, AbstractReferenceMap.SOFT);
}
}
return _oldSerializedViews;
}
/**
* Reads the value of the <code>org.apache.myfaces.CACHE_OLD_VIEWS_IN_SESSION_MODE</code> context parameter.
*
* @since 1.2.5
* @param context
* @return constant indicating caching mode
* @see CACHE_OLD_VIEWS_IN_SESSION_MODE
*/
protected String getCacheOldViewsInSessionMode(FacesContext context)
{
String value = context.getExternalContext().getInitParameter(
CACHE_OLD_VIEWS_IN_SESSION_MODE);
if (value == null)
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_OFF;
}
else if (value.equalsIgnoreCase(CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT))
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT;
}
else if (value.equalsIgnoreCase(CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT_WEAK))
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT_WEAK;
}
else if (value.equalsIgnoreCase(CACHE_OLD_VIEWS_IN_SESSION_MODE_WEAK))
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_WEAK;
}
else if (value.equalsIgnoreCase(CACHE_OLD_VIEWS_IN_SESSION_MODE_HARD_SOFT))
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_HARD_SOFT;
}
else
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_OFF;
}
}
public Object get(Integer sequence, String viewId)
{
Object key = new SerializedViewKey(viewId, sequence);
Object value = _serializedViews.get(key);
if (value == null)
{
Map<Object,Object> oldSerializedViewMap = getOldSerializedViewsMap();
if (oldSerializedViewMap != null)
{
value = oldSerializedViewMap.get(key);
}
}
return value;
}
}
protected static class SerializedViewKey implements Serializable
{
private static final long serialVersionUID = -1170697124386063642L;
private final String _viewId;
private final Integer _sequenceId;
public SerializedViewKey(String viewId, Integer sequence)
{
_sequenceId = sequence;
_viewId = viewId;
}
public SerializedViewKey(FacesContext context)
{
_sequenceId = RendererUtils.getViewSequence(context);
_viewId = context.getViewRoot().getViewId();
}
@Override
public int hashCode()
{
final int PRIME = 31;
int result = 1;
result = PRIME * result + ((_sequenceId == null) ? 0 : _sequenceId.hashCode());
result = PRIME * result + ((_viewId == null) ? 0 : _viewId.hashCode());
return result;
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final SerializedViewKey other = (SerializedViewKey) obj;
if (_sequenceId == null)
{
if (other._sequenceId != null)
return false;
}
else if (!_sequenceId.equals(other._sequenceId))
return false;
if (_viewId == null)
{
if (other._viewId != null)
return false;
}
else if (!_viewId.equals(other._viewId))
return false;
return true;
}
}
} |
File | Line |
---|
org/apache/myfaces/application/jsp/JspStateManagerImpl.java | 984 |
org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java | 667 |
}
/**
* Reads the amount (default = 20) of views to be stored in session.
* @see #NUMBER_OF_VIEWS_IN_SESSION_PARAM
* @param context FacesContext for the current request, we are processing
* @return Number vf views stored in the session
*/
protected int getNumberOfViewsInSession(FacesContext context)
{
String value = context.getExternalContext().getInitParameter(
NUMBER_OF_VIEWS_IN_SESSION_PARAM);
int views = DEFAULT_NUMBER_OF_VIEWS_IN_SESSION;
if (value != null)
{
try
{
views = Integer.parseInt(value);
if (views <= 0)
{
log.severe("Configured value for " + NUMBER_OF_VIEWS_IN_SESSION_PARAM
+ " is not valid, must be an value > 0, using default value ("
+ DEFAULT_NUMBER_OF_VIEWS_IN_SESSION);
views = DEFAULT_NUMBER_OF_VIEWS_IN_SESSION;
}
}
catch (Throwable e)
{
log.log(Level.SEVERE, "Error determining the value for " + NUMBER_OF_VIEWS_IN_SESSION_PARAM
+ ", expected an integer value > 0, using default value ("
+ DEFAULT_NUMBER_OF_VIEWS_IN_SESSION + "): " + e.getMessage(), e);
}
}
return views;
}
/**
* @return old serialized views map
*/
@SuppressWarnings("unchecked")
protected Map<Object, Object> getOldSerializedViewsMap()
{
FacesContext context = FacesContext.getCurrentInstance();
if (_oldSerializedViews == null && context != null)
{
String cacheMode = getCacheOldViewsInSessionMode(context);
if (CACHE_OLD_VIEWS_IN_SESSION_MODE_WEAK.equals(cacheMode))
{
_oldSerializedViews = new ReferenceMap(AbstractReferenceMap.WEAK, AbstractReferenceMap.WEAK, true);
}
else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT_WEAK.equals(cacheMode))
{
_oldSerializedViews = new ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.WEAK, true);
}
else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT.equals(cacheMode))
{
_oldSerializedViews = new ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.SOFT, true);
}
else if (CACHE_OLD_VIEWS_IN_SESSION_MODE_HARD_SOFT.equals(cacheMode))
{
_oldSerializedViews = new ReferenceMap(AbstractReferenceMap.HARD, AbstractReferenceMap.SOFT);
}
}
return _oldSerializedViews;
}
/**
* Reads the value of the <code>org.apache.myfaces.CACHE_OLD_VIEWS_IN_SESSION_MODE</code> context parameter.
*
* @since 1.2.5
* @param context
* @return constant indicating caching mode
* @see #CACHE_OLD_VIEWS_IN_SESSION_MODE
*/
protected String getCacheOldViewsInSessionMode(FacesContext context)
{
String value = context.getExternalContext().getInitParameter(
CACHE_OLD_VIEWS_IN_SESSION_MODE);
if (value == null)
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_OFF;
}
else if (value.equalsIgnoreCase(CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT))
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT;
}
else if (value.equalsIgnoreCase(CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT_WEAK))
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT_WEAK;
}
else if (value.equalsIgnoreCase(CACHE_OLD_VIEWS_IN_SESSION_MODE_WEAK))
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_WEAK;
}
else if (value.equalsIgnoreCase(CACHE_OLD_VIEWS_IN_SESSION_MODE_HARD_SOFT))
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_HARD_SOFT;
}
else
{
return CACHE_OLD_VIEWS_IN_SESSION_MODE_OFF;
}
}
public Object get(Integer sequence, String viewId)
{
Object key = new SerializedViewKey(viewId, sequence);
Object value = _serializedViews.get(key);
if (value == null)
{
Map<Object,Object> oldSerializedViewMap = getOldSerializedViewsMap();
if (oldSerializedViewMap != null)
{
value = oldSerializedViewMap.get(key);
}
}
return value;
}
}
protected static class SerializedViewKey implements Serializable
{
private static final long serialVersionUID = -1170697124386063642L;
private final String _viewId;
private final Integer _sequenceId;
public SerializedViewKey(String viewId, Integer sequence)
{
_sequenceId = sequence;
_viewId = viewId;
} |
File | Line |
---|
org/apache/myfaces/view/facelets/tag/MetaRulesetImpl.java | 137 |
org/apache/myfaces/view/facelets/tag/composite/CompositeMetaRulesetImpl.java | 109 |
}
public MetaRuleset add(Metadata mapper)
{
ParameterCheck.notNull("mapper", mapper);
if (!_mappers.contains(mapper))
{
_mappers.add(mapper);
}
return this;
}
public MetaRuleset addRule(MetaRule rule)
{
ParameterCheck.notNull("rule", rule);
_rules.add(rule);
return this;
}
public MetaRuleset alias(String attribute, String property)
{
ParameterCheck.notNull("attribute", attribute);
ParameterCheck.notNull("property", property);
TagAttribute attr = (TagAttribute) _attributes.remove(attribute);
if (attr != null)
{
_attributes.put(property, attr);
}
return this;
}
public Metadata finish()
{
assert !_rules.isEmpty();
if (!_attributes.isEmpty())
{
MetadataTarget target = this._getMetadataTarget();
int ruleEnd = _rules.size() - 1;
// now iterate over attributes
for (Map.Entry<String, TagAttribute> entry : _attributes.entrySet())
{
Metadata data = null;
int i = ruleEnd;
// First loop is always safe
do
{
MetaRule rule = _rules.get(i);
data = rule.applyRule(entry.getKey(), entry.getValue(), target);
i--;
} while (data == null && i >= 0);
if (data == null)
{
if (log.isLoggable(Level.SEVERE))
{
log.severe(entry.getValue() + " Unhandled by MetaTagHandler for type " + _type.getName());
}
}
else
{
_mappers.add(data);
}
}
}
if (_mappers.isEmpty())
{
return NONE;
}
else
{
return new MetadataImpl(_mappers.toArray(new Metadata[_mappers.size()]));
}
}
public MetaRuleset ignore(String attribute)
{
ParameterCheck.notNull("attribute", attribute);
_attributes.remove(attribute);
return this;
}
public MetaRuleset ignoreAll()
{
_attributes.clear();
return this;
}
private final MetadataTarget _getMetadataTarget()
{ |
File | Line |
---|
org/apache/myfaces/view/facelets/component/UIRepeat.java | 511 |
org/apache/myfaces/view/facelets/component/UIRepeat.java | 592 |
UIComponent child = parent.getChildren().get(i);
if (!child.isTransient())
{
// Add an entry to the collection, being an array of two
// elements. The first element is the state of the children
// of this component; the second is the state of the current
// child itself.
if (child instanceof EditableValueHolder)
{
if (childStates == null)
{
childStates = new ArrayList<Object[]>(
parent.getFacetCount()
+ parent.getChildCount()
- totalChildCount
+ childEmptyIndex);
for (int ci = 0; ci < childEmptyIndex; ci++)
{
childStates.add(LEAF_NO_STATE);
}
}
childStates.add(child.getChildCount() > 0 ?
new Object[]{new SavedState((EditableValueHolder) child),
saveDescendantComponentStates(child, saveChildFacets, true)} :
new Object[]{new SavedState((EditableValueHolder) child),
null});
}
else if (child.getChildCount() > 0 || (saveChildFacets && child.getFacetCount() > 0))
{
Object descendantSavedState = saveDescendantComponentStates(child, saveChildFacets, true);
if (descendantSavedState == null)
{
if (childStates == null)
{
childEmptyIndex++;
}
else
{
childStates.add(LEAF_NO_STATE);
}
}
else
{
if (childStates == null)
{
childStates = new ArrayList<Object[]>(
parent.getFacetCount()
+ parent.getChildCount()
- totalChildCount
+ childEmptyIndex);
for (int ci = 0; ci < childEmptyIndex; ci++)
{
childStates.add(LEAF_NO_STATE);
}
}
childStates.add(new Object[]{null, descendantSavedState});
}
}
else
{
if (childStates == null)
{
childEmptyIndex++;
}
else
{
childStates.add(LEAF_NO_STATE);
}
}
}
totalChildCount++;
}
} |
File | Line |
---|
org/apache/myfaces/view/facelets/compiler/_ComponentUtils.java | 171 |
org/apache/myfaces/view/facelets/tag/jsf/ComponentSupport.java | 494 |
public static UIComponent findComponentChildOrFacetFrom(UIComponent parent, String id, String innerExpr)
{
if (parent.getFacetCount() > 0)
{
for (UIComponent facet : parent.getFacets().values())
{
if (id.equals(facet.getId()))
{
if (innerExpr == null)
{
return facet;
}
else if (facet instanceof NamingContainer)
{
UIComponent find = facet.findComponent(innerExpr);
if (find != null)
{
return find;
}
}
}
else if (!(facet instanceof NamingContainer))
{
UIComponent find = findComponentChildOrFacetFrom(facet, id, innerExpr);
if (find != null)
{
return find;
}
}
}
}
if (parent.getChildCount() > 0)
{
for (int i = 0, childCount = parent.getChildCount(); i < childCount; i++)
{
UIComponent child = parent.getChildren().get(i);
if (id.equals(child.getId()))
{
if (innerExpr == null)
{
return child;
}
else if (child instanceof NamingContainer)
{
UIComponent find = child.findComponent(innerExpr);
if (find != null)
{
return find;
}
}
}
else if (!(child instanceof NamingContainer))
{
UIComponent find = findComponentChildOrFacetFrom(child, id, innerExpr);
if (find != null)
{
return find;
}
}
}
}
return null;
} |
File | Line |
---|
org/apache/myfaces/application/ViewHandlerImpl.java | 168 |
org/apache/myfaces/application/jsp/JspViewHandlerImpl.java | 148 |
}
/**
* Get the locales specified as acceptable by the original request, compare them to the
* locales supported by this Application and return the best match.
*/
@Override
public Locale calculateLocale(FacesContext facesContext)
{
Application application = facesContext.getApplication();
for (Iterator<Locale> requestLocales = facesContext.getExternalContext().getRequestLocales(); requestLocales
.hasNext();)
{
Locale requestLocale = requestLocales.next();
for (Iterator<Locale> supportedLocales = application.getSupportedLocales(); supportedLocales.hasNext();)
{
Locale supportedLocale = supportedLocales.next();
// higher priority to a language match over an exact match
// that occures further down (see Jstl Reference 1.0 8.3.1)
if (requestLocale.getLanguage().equals(supportedLocale.getLanguage())
&& (supportedLocale.getCountry() == null || supportedLocale.getCountry().length() == 0))
{
return supportedLocale;
}
else if (supportedLocale.equals(requestLocale))
{
return supportedLocale;
}
}
}
Locale defaultLocale = application.getDefaultLocale();
return defaultLocale != null ? defaultLocale : Locale.getDefault();
}
@Override
public String calculateRenderKitId(FacesContext facesContext)
{
Object renderKitId = facesContext.getExternalContext().getRequestMap().get(
ResponseStateManager.RENDER_KIT_ID_PARAM);
if (renderKitId == null)
{
renderKitId = facesContext.getApplication().getDefaultRenderKitId();
}
if (renderKitId == null)
{
renderKitId = RenderKitFactory.HTML_BASIC_RENDER_KIT;
}
return renderKitId.toString();
}
/**
* Create a UIViewRoot object and return it; the returned object has no children.
* <p>
* As required by the spec, the returned object inherits locale and renderkit settings from
* the viewRoot currently configured for the facesContext (if any). This means that on navigation
* from one view to another these settings are "inherited".
*/
@Override
public UIViewRoot createView(FacesContext facesContext, String viewId) |
File | Line |
---|
org/apache/myfaces/util/AbstractAttributeMap.java | 228 |
org/apache/myfaces/util/AbstractThreadSafeAttributeMap.java | 227 |
return getValue(_currentKey = _i.next());
}
protected abstract E getValue(String attributeName);
}
private final class KeyIterator extends AbstractAttributeIterator<String>
{
@Override
protected String getValue(final String attributeName)
{
return attributeName;
}
}
private class Values extends AbstractAttributeSet<V>
{
@Override
public Iterator<V> iterator()
{
return new ValuesIterator();
}
@Override
public boolean contains(final Object o)
{
if (o == null)
{
return false;
}
for (final Iterator<V> it = iterator(); it.hasNext();)
{
if (o.equals(it.next()))
{
return true;
}
}
return false;
}
@Override
public boolean remove(final Object o)
{
if (o == null)
{
return false;
}
for (final Iterator<V> it = iterator(); it.hasNext();)
{
if (o.equals(it.next()))
{
it.remove();
return true;
}
}
return false;
}
}
private class ValuesIterator extends AbstractAttributeIterator<V>
{
@Override
protected V getValue(final String attributeName)
{
return AbstractThreadSafeAttributeMap.this.get(attributeName); |
File | Line |
---|
org/apache/myfaces/application/ApplicationImpl.java | 1689 |
org/apache/myfaces/application/ApplicationImpl.java | 2167 |
if(isProduction && _classToResourceDependencyMap.containsKey(inspectedClass))
{
dependencyList = _classToResourceDependencyMap.get(inspectedClass);
if(dependencyList == null)
{
return; //class has been inspected and did not contain any resource dependency annotations
}
else if (dependencyList.isEmpty())
{
return;
}
isCachedList = true; // else annotations were found in the cache
}
if(dependencyList == null) //not in production or the class hasn't been inspected yet
{
ResourceDependency dependency = inspectedClass.getAnnotation(ResourceDependency.class);
ResourceDependencies dependencies = inspectedClass.getAnnotation(ResourceDependencies.class);
if(dependency != null || dependencies != null)
{
//resource dependencies were found using one or both annotations, create and build a new list
dependencyList = new ArrayList<ResourceDependency>();
if(dependency != null)
{
dependencyList.add(dependency);
}
if(dependencies != null)
{
dependencyList.addAll(Arrays.asList(dependencies.value()));
}
}
else
{
dependencyList = Collections.emptyList();
}
}
// resource dependencies were found through inspection or from cache, handle them
if (dependencyList != null && !dependencyList.isEmpty())
{
for (int i = 0, size = dependencyList.size(); i < size; i++)
{
ResourceDependency dependency = dependencyList.get(i);
if (!rvc.isResourceDependencyAlreadyProcessed(dependency))
{ |
File | Line |
---|
org/apache/myfaces/taglib/core/ValidatorImplTag.java | 116 |
org/apache/myfaces/taglib/core/ValidatorTag.java | 72 |
protected Validator createValidator() throws javax.servlet.jsp.JspException
{
FacesContext facesContext = FacesContext.getCurrentInstance();
ELContext elContext = facesContext.getELContext();
if (null != _binding)
{
Object validator;
try
{
validator = _binding.getValue(elContext);
}
catch (Exception e)
{
throw new JspException("Error while creating the Validator", e);
}
if (validator instanceof Validator)
{
return (Validator)validator;
}
}
Application application = facesContext.getApplication();
Validator validator = null;
try
{
// first check if an ValidatorId was set by a method
if (null != _validatorIdString)
{
validator = application.createValidator(_validatorIdString);
}
else if (null != _validatorId)
{
String validatorId = (String)_validatorId.getValue(elContext);
validator = application.createValidator(validatorId);
}
}
catch (Exception e)
{
throw new JspException("Error while creating the Validator", e);
}
if (null != validator)
{
if (null != _binding)
{
_binding.setValue(elContext, validator);
}
return validator;
}
throw new JspException("validatorId and/or binding must be specified");
}
} |
File | Line |
---|
org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java | 76 |
org/apache/myfaces/renderkit/html/HtmlStylesheetRenderer.java | 76 |
FacesContext facesContext = FacesContext.getCurrentInstance();
Location location = (Location) component.getAttributes().get(CompositeComponentELUtils.LOCATION_KEY);
if (location != null)
{
UIComponent ccParent
= CompositeComponentELUtils.getCompositeComponentBasedOnLocation(facesContext, location);
if (ccParent != null)
{
component.getAttributes().put(
CompositeComponentELUtils.CC_FIND_COMPONENT_EXPRESSION,
ComponentSupport.getFindComponentExpression(facesContext, ccParent));
}
}
// If this is an ajax request and the view is being refreshed and a PostAddToViewEvent
// was propagated to relocate this resource, means the header must be refreshed.
// Note ajax request does not occur on non postback requests.
if (!ExternalContextUtils.isPortlet(facesContext.getExternalContext()) &&
facesContext.getPartialViewContext().isAjaxRequest() )
{
boolean isBuildingInitialState = facesContext.getAttributes().
containsKey(IS_BUILDING_INITIAL_STATE);
// The next condition takes into account the current request is an ajax request.
boolean isPostAddToViewEventAfterBuildInitialState =
!isBuildingInitialState ||
(isBuildingInitialState &&
FaceletViewDeclarationLanguage.isRefreshingTransientBuild(facesContext));
if (isPostAddToViewEventAfterBuildInitialState &&
MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).
isStrictJsf2RefreshTargetAjax())
{
//!(component.getParent() instanceof ComponentResourceContainer)
RequestViewContext requestViewContext = RequestViewContext.getCurrentInstance(facesContext);
requestViewContext.setRenderTarget("head", true);
}
}
facesContext.getViewRoot().addComponentResource(facesContext,
component, "head"); |
File | Line |
---|
org/apache/myfaces/view/facelets/tag/composite/AttachedObjectTargetHandler.java | 88 |
org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorHandler.java | 115 |
(_default == null || _default.isLiteral() ))
{
_cacheable = true;
}
else
{
_cacheable = false;
}
}
@SuppressWarnings("unchecked")
public void apply(FaceletContext ctx, UIComponent parent)
throws IOException
{
UIComponent compositeBaseParent = FaceletCompositionContext.getCurrentInstance(ctx).getCompositeComponentFromStack();
CompositeComponentBeanInfo beanInfo =
(CompositeComponentBeanInfo) compositeBaseParent.getAttributes()
.get(UIComponent.BEANINFO_KEY);
if (beanInfo == null)
{
if (log.isLoggable(Level.SEVERE))
{
log.severe("Cannot find composite bean descriptor UIComponent.BEANINFO_KEY ");
}
return;
}
BeanDescriptor beanDescriptor = beanInfo.getBeanDescriptor();
//1. Obtain the list mentioned as "targetList" on ViewDeclarationLanguage.retargetAttachedObjects
List<AttachedObjectTarget> targetList = (List<AttachedObjectTarget>)
beanDescriptor.getValue(
AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY);
if (targetList == null)
{
//2. If not found create it and set
targetList = new ArrayList<AttachedObjectTarget>();
beanDescriptor.setValue(
AttachedObjectTarget.ATTACHED_OBJECT_TARGETS_KEY,
targetList);
}
//3. Create the instance of AttachedObjectTarget
if (isCacheable())
{
if (_target == null)
{
_target = createAttachedObjectTarget(ctx);
}
targetList.add(_target);
}
else
{ |
File | Line |
---|
org/apache/myfaces/taglib/core/ConverterImplTag.java | 106 |
org/apache/myfaces/taglib/core/ConverterTag.java | 77 |
protected Converter createConverter() throws JspException
{
Converter converter = null;
FacesContext facesContext = FacesContext.getCurrentInstance();
ELContext elContext = facesContext.getELContext();
// try to create the converter from the binding expression first, and then from
// the converterId
if (_binding != null)
{
try
{
converter = (Converter)_binding.getValue(elContext);
if (converter != null)
{
return converter;
}
}
catch (Exception e)
{
throw new JspException("Exception creating converter using binding", e);
}
}
if ((_converterId != null) || (_converterIdString != null))
{
try
{
if (null != _converterIdString)
{
converter = facesContext.getApplication().createConverter(_converterIdString);
}
else
{
String converterId = (String)_converterId.getValue(elContext);
converter = facesContext.getApplication().createConverter(converterId);
}
// with binding no converter was created, set its value with the converter
// created using the converterId
if (converter != null && _binding != null)
{
_binding.setValue(elContext, converter);
}
}
catch (Exception e)
{
throw new JspException("Exception creating converter with converterId: " + _converterId, e);
}
} |
File | Line |
---|
org/apache/myfaces/view/facelets/component/UIRepeat.java | 357 |
org/apache/myfaces/view/facelets/component/UIRepeat.java | 400 |
UIComponent component = parent.getChildren().get(i);
// reset the client id (see spec 3.1.6)
component.setId(component.getId());
if (!component.isTransient())
{
if (descendantStateIndex == -1)
{
stateCollection = ((List<? extends Object[]>) state);
descendantStateIndex = stateCollection.isEmpty() ? -1 : 0;
}
if (descendantStateIndex != -1 && descendantStateIndex < stateCollection.size())
{
Object[] object = stateCollection.get(descendantStateIndex);
if (object[0] != null && component instanceof EditableValueHolder)
{
((SavedState) object[0]).restoreState((EditableValueHolder) component);
}
// If there is descendant state to restore, call it recursively, otherwise
// it is safe to skip iteration.
if (object[1] != null)
{
restoreDescendantComponentStates(component, restoreChildFacets, object[1], true);
}
else
{
restoreDescendantComponentWithoutRestoreState(component, restoreChildFacets, true);
}
}
else
{
restoreDescendantComponentWithoutRestoreState(component, restoreChildFacets, true);
}
descendantStateIndex++;
}
}
} |
File | Line |
---|
org/apache/myfaces/config/impl/digester/elements/Attribute.java | 60 |
org/apache/myfaces/config/impl/digester/elements/Property.java | 60 |
_description.add(value);
}
public Collection<? extends String> getDescriptions()
{
if(_description == null)
{
return Collections.emptyList();
}
return _description;
}
public void addDisplayName(String value)
{
if(_displayName == null)
{
_displayName = new ArrayList<String>();
}
_displayName.add(value);
}
public Collection<? extends String> getDisplayNames()
{
if(_displayName==null)
{
return Collections.emptyList();
}
return _displayName;
}
public void addIcon(String value)
{
if(_icon == null)
{
_icon = new ArrayList<String>();
}
_icon.add(value);
}
public Collection<? extends String> getIcons()
{
if(_icon == null)
{
return Collections.emptyList();
}
return _icon;
}
public void setPropertyName(String propertyName) |
File | Line |
---|
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 284 |
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 472 |
if (this.inDocument && inCompositeInterface)
{
this.unit.writeComment(new String(ch, start, length));
}
}
protected TagAttributes createAttributes(Attributes attrs)
{
int len = attrs.getLength();
TagAttribute[] ta = new TagAttribute[len];
for (int i = 0; i < len; i++)
{
ta[i] = new TagAttributeImpl(this.createLocation(), attrs.getURI(i), attrs.getLocalName(i), attrs
.getQName(i), attrs.getValue(i));
}
return new TagAttributesImpl(ta);
}
protected Location createLocation()
{
return new Location(this.alias, this.locator.getLineNumber(), this.locator.getColumnNumber());
}
public void endCDATA() throws SAXException
{
if (this.inDocument && inCompositeInterface) |
File | Line |
---|
org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java | 907 |
org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java | 956 |
componentAddedAfterBuildView
= (ComponentState) child.getAttributes().get(COMPONENT_ADDED_AFTER_BUILD_VIEW);
if (componentAddedAfterBuildView != null)
{
if (ComponentState.REMOVE_ADD.equals(componentAddedAfterBuildView))
{
registerOnAddRemoveList(context, child.getClientId(context));
child.getAttributes().put(COMPONENT_ADDED_AFTER_BUILD_VIEW, ComponentState.ADDED);
}
else if (ComponentState.ADD.equals(componentAddedAfterBuildView))
{
registerOnAddList(context, child.getClientId(context));
child.getAttributes().put(COMPONENT_ADDED_AFTER_BUILD_VIEW, ComponentState.ADDED);
}
else if (ComponentState.ADDED.equals(componentAddedAfterBuildView))
{
registerOnAddList(context, child.getClientId(context));
}
//Save all required info to restore the subtree.
//This includes position, structure and state of subtree
ensureClearInitialState(child);
states.put(child.getClientId(context),new AttachedFullStateWrapper(new Object[]{
component.getClientId(context), |
File | Line |
---|
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 97 |
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 284 |
if (this.inDocument && inMetadata)
{
this.unit.writeComment(new String(ch, start, length));
}
}
protected TagAttributes createAttributes(Attributes attrs)
{
int len = attrs.getLength();
TagAttribute[] ta = new TagAttribute[len];
for (int i = 0; i < len; i++)
{
ta[i] = new TagAttributeImpl(this.createLocation(), attrs.getURI(i), attrs.getLocalName(i), attrs
.getQName(i), attrs.getValue(i));
}
return new TagAttributesImpl(ta);
}
protected Location createLocation()
{
return new Location(this.alias, this.locator.getLineNumber(), this.locator.getColumnNumber());
}
public void endCDATA() throws SAXException
{
if (this.inDocument && inMetadata) |
File | Line |
---|
org/apache/myfaces/view/facelets/el/RedirectMethodExpressionValueExpressionActionListener.java | 54 |
org/apache/myfaces/view/facelets/el/RedirectMethodExpressionValueExpressionValidator.java | 56 |
getMethodExpression().invoke(FacesContext.getCurrentInstance().getELContext(), new Object[]{event});
}
private MethodExpression getMethodExpression()
{
return getMethodExpression(FacesContext.getCurrentInstance().getELContext());
}
private MethodExpression getMethodExpression(ELContext context)
{
Object meOrVe = valueExpression.getValue(context);
if (meOrVe instanceof MethodExpression)
{
return (MethodExpression) meOrVe;
}
else if (meOrVe instanceof ValueExpression)
{
while (meOrVe != null && meOrVe instanceof ValueExpression)
{
meOrVe = ((ValueExpression)meOrVe).getValue(context);
}
return (MethodExpression) meOrVe;
}
else
{
return null;
}
}
public ValueExpression getWrapped()
{
return valueExpression;
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
this.valueExpression = (ValueExpression) in.readObject();
}
public void writeExternal(ObjectOutput out) throws IOException
{
out.writeObject(this.valueExpression);
}
} |
File | Line |
---|
org/apache/myfaces/view/facelets/el/RedirectMethodExpressionValueExpressionActionListener.java | 54 |
org/apache/myfaces/view/facelets/el/ValueExpressionMethodExpression.java | 93 |
return getMethodExpression().isLiteralText();
}
private MethodExpression getMethodExpression()
{
return getMethodExpression(FacesContext.getCurrentInstance().getELContext());
}
private MethodExpression getMethodExpression(ELContext context)
{
Object meOrVe = valueExpression.getValue(context);
if (meOrVe instanceof MethodExpression)
{
return (MethodExpression) meOrVe;
}
else if (meOrVe instanceof ValueExpression)
{
while (meOrVe != null && meOrVe instanceof ValueExpression)
{
meOrVe = ((ValueExpression)meOrVe).getValue(context);
}
return (MethodExpression) meOrVe;
}
else
{
return null;
}
}
public ValueExpression getWrapped()
{
return valueExpression;
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
this.valueExpression = (ValueExpression) in.readObject();
}
public void writeExternal(ObjectOutput out) throws IOException
{
out.writeObject(this.valueExpression);
}
} |
File | Line |
---|
org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java | 135 |
org/apache/myfaces/renderkit/html/HtmlStylesheetRenderer.java | 115 |
}
}
@Override
public boolean getRendersChildren()
{
return true;
}
@Override
public void encodeChildren(FacesContext facesContext, UIComponent component)
throws IOException
{
if (facesContext == null)
{
throw new NullPointerException("context");
}
if (component == null)
{
throw new NullPointerException("component");
}
Map<String, Object> componentAttributesMap = component.getAttributes();
String resourceName = (String) componentAttributesMap.get(JSFAttr.NAME_ATTR);
boolean hasChildren = component.getChildCount() > 0;
if (resourceName != null && (!"".equals(resourceName)) )
{
if (hasChildren)
{
log.info("Component with resourceName "+ resourceName +
" and child components found. Child components will be ignored.");
}
}
else
{
if (hasChildren)
{
ResponseWriter writer = facesContext.getResponseWriter();
writer.startElement(HTML.STYLE_ELEM, component); |
File | Line |
---|
org/apache/myfaces/util/AbstractAttributeMap.java | 385 |
org/apache/myfaces/util/AbstractThreadSafeAttributeMap.java | 384 |
return AbstractThreadSafeAttributeMap.this.put(_currentKey, value);
}
@Override
public int hashCode()
{
int result = 1;
result = 31 * result + ((_currentKey == null) ? 0 : _currentKey.hashCode());
return result;
}
@Override
public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final EntrySetEntry other = (EntrySetEntry)obj;
if (_currentKey == null)
{
if (other._currentKey != null)
{
return false;
}
}
else if (!_currentKey.equals(other._currentKey))
{
return false;
}
return true;
}
}
} |
File | Line |
---|
org/apache/myfaces/config/impl/digester/DigesterFacesConfigDispenserImpl.java | 57 |
org/apache/myfaces/config/impl/digester/elements/Factory.java | 30 |
private List<String> applicationFactories = new ArrayList<String>();
private List<String> exceptionHandlerFactories = new ArrayList<String>();
private List<String> externalContextFactories = new ArrayList<String>();
private List<String> facesContextFactories = new ArrayList<String>();
private List<String> lifecycleFactories = new ArrayList<String>();
private List<String> ViewDeclarationLanguageFactories = new ArrayList<String>();
private List<String> partialViewContextFactories = new ArrayList<String>();
private List<String> renderKitFactories = new ArrayList<String>();
private List<String> tagHandlerDelegateFactories = new ArrayList<String>();
private List<String> visitContextFactories = new ArrayList<String>(); |
File | Line |
---|
org/apache/myfaces/config/DefaultFacesConfigurationMerger.java | 360 |
org/apache/myfaces/config/DefaultFacesConfigurationMerger.java | 545 |
sortedList.add(resource);
}
}
//Check
for (int i = 0; i < sortedList.size(); i++)
{
FacesConfig resource = sortedList.get(i);
if (resource.getOrdering() != null)
{
for (OrderSlot slot : resource.getOrdering().getBeforeList())
{
if (slot instanceof FacesConfigNameSlot)
{
String name = ((FacesConfigNameSlot) slot).getName();
if (name != null && !"".equals(name))
{
boolean founded = false;
for (int j = i-1; j >= 0; j--)
{
if (name.equals(sortedList.get(j).getName()))
{
founded=true;
break;
}
}
if (founded)
{ |
File | Line |
---|
org/apache/myfaces/application/TreeStructureManager.java | 50 |
org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java | 1191 |
}
private TreeStructComponent internalBuildTreeStructureToSave(UIComponent component)
{
TreeStructComponent structComp = new TreeStructComponent(component.getClass().getName(),
component.getId());
//children
if (component.getChildCount() > 0)
{
List<TreeStructComponent> structChildList = new ArrayList<TreeStructComponent>();
for (int i = 0, childCount = component.getChildCount(); i < childCount; i++)
{
UIComponent child = component.getChildren().get(i);
if (!child.isTransient())
{
TreeStructComponent structChild = internalBuildTreeStructureToSave(child);
structChildList.add(structChild);
}
}
TreeStructComponent[] childArray = structChildList.toArray(new TreeStructComponent[structChildList.size()]);
structComp.setChildren(childArray);
} |
File | Line |
---|
org/apache/myfaces/view/facelets/tag/ui/CompositionHandler.java | 83 |
org/apache/myfaces/view/facelets/tag/ui/DecorateHandler.java | 89 |
_handlers = new HashMap<String, DefineHandler>();
for (DefineHandler handler : TagHandlerUtils.findNextByType(nextHandler, DefineHandler.class))
{
_handlers.put(handler.getName(), handler);
if (log.isLoggable(Level.FINE))
{
log.fine(tag + " found Define[" + handler.getName() + "]");
}
}
Collection<ParamHandler> params = TagHandlerUtils.findNextByType(nextHandler, ParamHandler.class);
if (!params.isEmpty())
{
int i = 0;
_params = new ParamHandler[params.size()];
for (ParamHandler handler : params)
{
_params[i++] = handler;
}
}
else
{
_params = null;
}
} |
File | Line |
---|
org/apache/myfaces/config/DefaultFacesConfigurationMerger.java | 909 |
org/apache/myfaces/config/DefaultFacesConfigurationMerger.java | 959 |
for (OrderSlot slot : facesConfig.getOrdering().getAfterList())
{
if (slot instanceof FacesConfigNameSlot)
{
FacesConfigNameSlot nameSlot = (FacesConfigNameSlot) slot;
//The resource pointed is not added yet?
boolean alreadyAdded = false;
for (FacesConfig res : postOrderedList)
{
if (nameSlot.getName().equals(res.getName()))
{
alreadyAdded = true;
break;
}
}
if (!alreadyAdded)
{
int indexSlot = -1;
//Find it
for (int i = 0; i < appConfigResources.size(); i++)
{
FacesConfig resource = appConfigResources.get(i);
if (resource.getName() != null && nameSlot.getName().equals(resource.getName()))
{
indexSlot = i;
break;
}
}
//Resource founded on appConfigResources
if (indexSlot != -1)
{
pointingResource = true; |
File | Line |
---|
org/apache/myfaces/view/facelets/el/ELText.java | 194 |
org/apache/myfaces/view/facelets/el/ELText.java | 296 |
}
public void write(Writer out, ELContext ctx) throws ELException, IOException
{
Object v = this.ve.getValue(ctx);
if (v != null)
{
out.write((String) v);
}
}
public String toString(ELContext ctx) throws ELException
{
Object v = this.ve.getValue(ctx);
if (v != null)
{
return v.toString();
}
return null;
}
public void writeText(ResponseWriter out, ELContext ctx) throws ELException, IOException
{
Object v = this.ve.getValue(ctx);
if (v != null)
{
out.writeText((String) v, null);
}
}
} |
File | Line |
---|
org/apache/myfaces/util/AbstractAttributeMap.java | 296 |
org/apache/myfaces/util/AbstractThreadSafeAttributeMap.java | 295 |
return AbstractThreadSafeAttributeMap.this.get(attributeName);
}
}
private final class EntrySet extends AbstractAttributeSet<Entry<String, V>>
{
@Override
public Iterator<Entry<String, V>> iterator()
{
return new EntryIterator();
}
@SuppressWarnings("unchecked")
@Override
public boolean contains(final Object o)
{
if (!(o instanceof Entry))
{
return false;
}
final Entry<String, V> entry = (Entry<String, V>)o;
final Object key = entry.getKey();
final Object value = entry.getValue();
if (key == null || value == null)
{
return false;
}
return value.equals(AbstractThreadSafeAttributeMap.this.get(key)); |
File | Line |
---|
org/apache/myfaces/application/TreeStructureManager.java | 145 |
org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java | 1269 |
UIComponent child = internalRestoreTreeStructure(structChild);
facetMap.put(facetName, child);
}
}
return component;
}
public static class TreeStructComponent implements Serializable
{
private static final long serialVersionUID = 5069109074684737231L;
private String _componentClass;
private String _componentId;
private TreeStructComponent[] _children = null; // Array of children
private Object[] _facets = null; // Array of Array-tuples with Facetname and TreeStructComponent
TreeStructComponent(String componentClass, String componentId)
{
_componentClass = componentClass;
_componentId = componentId;
}
public String getComponentClass()
{
return _componentClass;
}
public String getComponentId()
{
return _componentId;
}
void setChildren(TreeStructComponent[] children)
{
_children = children;
}
TreeStructComponent[] getChildren()
{
return _children;
}
Object[] getFacets()
{
return _facets;
}
void setFacets(Object[] facets)
{
_facets = facets;
}
}
} |
File | Line |
---|
org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java | 1039 |
org/apache/myfaces/view/facelets/compiler/CheckDuplicateIdFaceletUtils.java | 89 |
if (component == null)
{
return;
}
// Need to use this form of the client ID method so we generate the client-side ID.
id = component.getClientId (context);
if (existingIds.contains (id))
{
throw new IllegalStateException ("component with duplicate id \"" + id + "\" found");
}
existingIds.add (id);
int facetCount = component.getFacetCount();
if (facetCount > 0)
{
for (UIComponent facet : component.getFacets().values())
{
checkIds (context, facet, existingIds);
}
}
for (int i = 0, childCount = component.getChildCount(); i < childCount; i++)
{
UIComponent child = component.getChildren().get(i);
checkIds (context, child, existingIds);
}
} |
File | Line |
---|
org/apache/myfaces/application/jsp/JspStateManagerImpl.java | 893 |
org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java | 498 |
}
return object;
}
finally
{
if (ois != null)
{
ois.close();
ois = null;
}
}
}
catch (PrivilegedActionException e)
{
log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
return null;
}
catch (IOException e)
{
log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
return null;
}
catch (ClassNotFoundException e)
{
log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
return null;
}
}
else if (state instanceof Object[])
{
if (log.isLoggable(Level.FINEST)) |
File | Line |
---|
org/apache/myfaces/application/StateManagerImpl.java | 323 |
org/apache/myfaces/view/facelets/compiler/_ComponentUtils.java | 421 |
}
private static void getPathToComponent(UIComponent component, StringBuffer buf)
{
if (component == null)
{
return;
}
StringBuffer intBuf = new StringBuffer();
intBuf.append("[Class: ");
intBuf.append(component.getClass().getName());
if (component instanceof UIViewRoot)
{
intBuf.append(",ViewId: ");
intBuf.append(((UIViewRoot)component).getViewId());
}
else
{
intBuf.append(",Id: ");
intBuf.append(component.getId());
}
intBuf.append("]");
buf.insert(0, intBuf.toString());
getPathToComponent(component.getParent(), buf);
} |
File | Line |
---|
org/apache/myfaces/util/AbstractAttributeMap.java | 53 |
org/apache/myfaces/util/AbstractThreadSafeAttributeMap.java | 49 |
for (String name : names)
{
removeAttribute(name);
}
}
@Override
public final boolean containsKey(final Object key)
{
return getAttribute(key.toString()) != null;
}
@Override
public boolean containsValue(final Object findValue)
{
if (findValue == null)
{
return false;
}
for (final Enumeration<String> e = getAttributeNames(); e.hasMoreElements();)
{
final Object value = getAttribute(e.nextElement());
if (findValue.equals(value))
{
return true;
}
}
return false;
}
@Override
public Set<Entry<String, V>> entrySet()
{
return _entrySet; |
File | Line |
---|
org/apache/myfaces/application/StateManagerImpl.java | 325 |
org/apache/myfaces/view/facelets/compiler/UILeaf.java | 240 |
private void getPathToComponent(UIComponent component, StringBuffer buf)
{
if (component == null)
{
return;
}
StringBuffer intBuf = new StringBuffer();
intBuf.append("[Class: ");
intBuf.append(component.getClass().getName());
if (component instanceof UIViewRoot)
{
intBuf.append(",ViewId: ");
intBuf.append(((UIViewRoot) component).getViewId());
}
else
{
intBuf.append(",Id: ");
intBuf.append(component.getId());
}
intBuf.append("]");
buf.insert(0, intBuf.toString());
getPathToComponent(component.getParent(), buf);
} |
File | Line |
---|
org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java | 225 |
org/apache/myfaces/view/facelets/tag/AbstractTagLibrary.java | 400 |
}
}
private static class ComponentConfigWrapper implements ComponentConfig
{
protected final TagConfig parent;
protected final String componentType;
protected final String rendererType;
public ComponentConfigWrapper(TagConfig parent, String componentType, String rendererType)
{
this.parent = parent;
this.componentType = componentType;
this.rendererType = rendererType;
}
public String getComponentType()
{
return this.componentType;
}
public String getRendererType()
{
return this.rendererType;
}
public FaceletHandler getNextHandler()
{
return this.parent.getNextHandler();
}
public Tag getTag()
{
return this.parent.getTag();
}
public String getTagId()
{
return this.parent.getTagId();
}
}
private static class UserTagFactory implements TagHandlerFactory |
File | Line |
---|
org/apache/myfaces/view/facelets/tag/composite/InsertFacetHandler.java | 98 |
org/apache/myfaces/view/facelets/tag/composite/RenderFacetHandler.java | 80 |
public void apply(FaceletContext ctx, UIComponent parent)
throws IOException
{
if (((AbstractFaceletContext)ctx).isBuildingCompositeComponentMetadata())
{
String facetName = _name.getValue(ctx);
UIComponent compositeBaseParent = FaceletCompositionContext.getCurrentInstance(ctx).getCompositeComponentFromStack();
CompositeComponentBeanInfo beanInfo =
(CompositeComponentBeanInfo) compositeBaseParent.getAttributes()
.get(UIComponent.BEANINFO_KEY);
if (beanInfo == null)
{
if (log.isLoggable(Level.SEVERE))
{
log.severe("Cannot find composite bean descriptor UIComponent.BEANINFO_KEY ");
}
return;
}
BeanDescriptor beanDescriptor = beanInfo.getBeanDescriptor();
List<String> facetList = (List<String>) beanDescriptor.getValue(RENDER_FACET_USED); |
File | Line |
---|
org/apache/myfaces/config/DefaultFacesConfigurationProvider.java | 364 |
org/apache/myfaces/config/FacesConfigurator.java | 434 |
String configFiles = _externalContext.getInitParameter(FacesServlet.CONFIG_FILES_ATTR);
List<String> configFilesList = new ArrayList<String>();
if (configFiles != null)
{
StringTokenizer st = new StringTokenizer(configFiles, ",", false);
while (st.hasMoreTokens())
{
String systemId = st.nextToken().trim();
if (DEFAULT_FACES_CONFIG.equals(systemId))
{
if (log.isLoggable(Level.WARNING))
{
log.warning(DEFAULT_FACES_CONFIG + " has been specified in the "
+ FacesServlet.CONFIG_FILES_ATTR
+ " context parameter of "
+ "the deployment descriptor. This will automatically be removed, "
+ "if we wouldn't do this, it would be loaded twice. See JSF spec 1.1, 10.3.2");
}
}
else
{
configFilesList.add(systemId);
}
}
}
return configFilesList;
}
private void configureFactories() |
File | Line |
---|
org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java | 226 |
org/apache/myfaces/view/facelets/tag/composite/CompositeResourceLibrary.java | 128 |
}
private static class ComponentConfigWrapper implements ComponentConfig
{
protected final TagConfig parent;
protected final String componentType;
protected final String rendererType;
public ComponentConfigWrapper(TagConfig parent, String componentType,
String rendererType)
{
this.parent = parent;
this.componentType = componentType;
this.rendererType = rendererType;
}
public String getComponentType()
{
return this.componentType;
}
public String getRendererType()
{
return this.rendererType;
}
public FaceletHandler getNextHandler()
{
return this.parent.getNextHandler();
}
public Tag getTag()
{
return this.parent.getTag();
}
public String getTagId()
{
return this.parent.getTagId();
}
} |
File | Line |
---|
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 673 |
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 710 |
ViewMetadataHandler handler = new ViewMetadataHandler(mngr, alias);
SAXParser parser = this.createSAXParser(handler);
parser.parse(is, handler);
}
catch (SAXException e)
{
throw new FaceletException("Error Parsing " + alias + ": " + e.getMessage(), e.getCause());
}
catch (ParserConfigurationException e)
{
throw new FaceletException("Error Configuring Parser " + alias + ": " + e.getMessage(), e.getCause());
}
finally
{
if (is != null)
{
is.close();
}
}
return new EncodingHandler(mngr.createFaceletHandler(), encoding);
}
/**
* @since 2.0.1
*/
@Override
protected FaceletHandler doCompileCompositeComponentMetadata(URL src, String alias) |
File | Line |
---|
org/apache/myfaces/application/TreeStructureManager.java | 79 |
org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java | 1221 |
List<Object[]> structFacetList = new ArrayList<Object[]>();
for (Map.Entry<String, UIComponent> entry : facetMap.entrySet())
{
UIComponent child = entry.getValue();
if (!child.isTransient())
{
String facetName = entry.getKey();
TreeStructComponent structChild = internalBuildTreeStructureToSave(child);
structFacetList.add(new Object[] {facetName, structChild});
}
}
Object[] facetArray = structFacetList.toArray(new Object[structFacetList.size()]);
structComp.setFacets(facetArray);
}
return structComp;
} |
File | Line |
---|
org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java | 185 |
org/apache/myfaces/renderkit/html/HtmlStylesheetRenderer.java | 161 |
if (!facesContext.isProjectStage(ProjectStage.Production))
{
facesContext.addMessage(component.getClientId(facesContext),
new FacesMessage("Component with no name and no body content, so nothing rendered."));
}
}
}
}
@Override
public void encodeEnd(FacesContext facesContext, UIComponent component)
throws IOException
{
super.encodeEnd(facesContext, component); //check for NP
Map<String, Object> componentAttributesMap = component.getAttributes();
String resourceName = (String) componentAttributesMap.get(JSFAttr.NAME_ATTR);
String libraryName = (String) componentAttributesMap.get(JSFAttr.LIBRARY_ATTR);
if (resourceName == null)
{
//log.warn("Trying to encode resource represented by component" +
// component.getClientId() + " without resourceName."+
// " It will be silenty ignored.");
return;
}
if ("".equals(resourceName))
{
return;
} |
File | Line |
---|
org/apache/myfaces/application/jsp/JspStateManagerImpl.java | 86 |
org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementHelper.java | 72 |
DefaultFaceletsStateManagementHelper.class.getName() + ".RESTORED_SERIALIZED_VIEW";
/**
* Only applicable if state saving method is "server" (= default).
* Defines the amount (default = 20) of the latest views are stored in session.
*/
private static final String NUMBER_OF_VIEWS_IN_SESSION_PARAM = "org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION";
/**
* Default value for <code>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</code> context parameter.
*/
private static final int DEFAULT_NUMBER_OF_VIEWS_IN_SESSION = 20;
/**
* Only applicable if state saving method is "server" (= default).
* If <code>true</code> (default) the state will be serialized to a byte stream before it is written to the session.
* If <code>false</code> the state will not be serialized to a byte stream.
*/
private static final String SERIALIZE_STATE_IN_SESSION_PARAM = "org.apache.myfaces.SERIALIZE_STATE_IN_SESSION";
/**
* Only applicable if state saving method is "server" (= default) and if <code>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</code> is <code>true</code> (= default).
* If <code>true</code> (default) the serialized state will be compressed before it is written to the session.
* If <code>false</code> the state will not be compressed.
*/
private static final String COMPRESS_SERVER_STATE_PARAM = "org.apache.myfaces.COMPRESS_STATE_IN_SESSION";
/**
* Default value for <code>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</code> context parameter.
*/
private static final boolean DEFAULT_COMPRESS_SERVER_STATE_PARAM = true;
/**
* Default value for <code>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</code> context parameter.
*/
private static final boolean DEFAULT_SERIALIZE_STATE_IN_SESSION = true;
/**
* Define the way of handle old view references(views removed from session), making possible to
* store it in a cache, so the state manager first try to get the view from the session. If is it
* not found and soft or weak ReferenceMap is used, it try to get from it.
* <p>
* Only applicable if state saving method is "server" (= default).
* </p>
* <p>
* The gc is responsible for remove the views, according to the rules used for soft, weak or phantom
* references. If a key in soft and weak mode is garbage collected, its values are purged.
* </p>
* <p>
* By default no cache is used, so views removed from session became phantom references.
* </p>
* <ul>
* <li> off, no: default, no cache is used</li>
* <li> hard-soft: use an ReferenceMap(AbstractReferenceMap.HARD, AbstractReferenceMap.SOFT)</li>
* <li> soft: use an ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.SOFT, true) </li>
* <li> soft-weak: use an ReferenceMap(AbstractReferenceMap.SOFT, AbstractReferenceMap.WEAK, true) </li>
* <li> weak: use an ReferenceMap(AbstractReferenceMap.WEAK, AbstractReferenceMap.WEAK, true) </li>
* </ul>
*
*/
private static final String CACHE_OLD_VIEWS_IN_SESSION_MODE = "org.apache.myfaces.CACHE_OLD_VIEWS_IN_SESSION_MODE";
/**
* This option uses an hard-soft ReferenceMap, but it could cause a
* memory leak, because the keys are not removed by any method
* (MYFACES-1660). So use with caution.
*/
private static final String CACHE_OLD_VIEWS_IN_SESSION_MODE_HARD_SOFT = "hard-soft";
private static final String CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT = "soft";
private static final String CACHE_OLD_VIEWS_IN_SESSION_MODE_SOFT_WEAK = "soft-weak";
private static final String CACHE_OLD_VIEWS_IN_SESSION_MODE_WEAK = "weak";
private static final String CACHE_OLD_VIEWS_IN_SESSION_MODE_OFF = "off";
private static final int UNCOMPRESSED_FLAG = 0;
private static final int COMPRESSED_FLAG = 1;
private static final int JSF_SEQUENCE_INDEX = 0; |
File | Line |
---|
org/apache/myfaces/application/StateManagerImpl.java | 332 |
org/apache/myfaces/application/jsp/JspStateManagerImpl.java | 544 |
StringBuffer intBuf = new StringBuffer();
intBuf.append("[Class: ");
intBuf.append(component.getClass().getName());
if(component instanceof UIViewRoot)
{
intBuf.append(",ViewId: ");
intBuf.append(((UIViewRoot) component).getViewId());
}
else
{
intBuf.append(",Id: ");
intBuf.append(component.getId());
}
intBuf.append("]");
buf.insert(0,intBuf.toString());
getPathToComponent(component.getParent(),buf);
}
@Override
public void writeState(FacesContext facesContext, |
File | Line |
---|
org/apache/myfaces/view/facelets/compiler/UIInstructionHandler.java | 177 |
org/apache/myfaces/view/facelets/compiler/UITextHandler.java | 85 |
}
}
}
public String toString()
{
return this.txt.toString();
}
public String getText()
{
return this.txt.toString();
}
public String getText(FaceletContext ctx)
{
Writer writer = new FastWriter(this.length);
try
{
this.txt.apply(ctx.getExpressionFactory(), ctx).write(writer, ctx);
}
catch (IOException e)
{
throw new ELException(this.alias + ": " + e.getMessage(), e.getCause());
}
return writer.toString();
}
} |
File | Line |
---|
org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java | 195 |
org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementHelper.java | 154 |
protected Integer getServerStateId(Object[] state)
{
if (state != null)
{
Object serverStateId = state[JSF_SEQUENCE_INDEX];
if (serverStateId != null)
{
return Integer.valueOf((String) serverStateId, Character.MAX_RADIX);
}
}
return null;
}
protected void saveSerializedViewInServletSession(FacesContext context,
Object serializedView)
{
Map<String, Object> sessionMap = context.getExternalContext().getSessionMap();
SerializedViewCollection viewCollection = (SerializedViewCollection) sessionMap
.get(SERIALIZED_VIEW_SESSION_ATTR);
if (viewCollection == null)
{
viewCollection = new SerializedViewCollection();
sessionMap.put(SERIALIZED_VIEW_SESSION_ATTR, viewCollection);
} |
File | Line |
---|
org/apache/myfaces/view/facelets/impl/DefaultFaceletContext.java | 683 |
org/apache/myfaces/view/facelets/impl/TemplateContextImpl.java | 178 |
this._names.add(testName);
boolean found = false;
AbstractFaceletContext actx = new DefaultFaceletContext(
(DefaultFaceletContext) ctx, this._owner, false);
ctx.getFacesContext().getAttributes().put(FaceletContext.FACELET_CONTEXT_KEY, actx);
try
{
actx.pushPageContext(this._pageContext);
found = this._target
.apply(actx,
parent, name);
}
finally
{
actx.popPageContext();
}
ctx.getFacesContext().getAttributes().put(FaceletContext.FACELET_CONTEXT_KEY, ctx);
this._names.remove(testName);
return found;
}
}
public Map<String, ValueExpression> getParametersMap() |
File | Line |
---|
org/apache/myfaces/taglib/core/DelegateActionListener.java | 60 |
org/apache/myfaces/taglib/core/DelegateValueChangeListener.java | 57 |
public DelegateValueChangeListener(ValueExpression type, ValueExpression binding)
{
super();
_type = type;
_binding = binding;
}
public boolean isTransient()
{
return false;
}
public void restoreState(FacesContext facesContext, Object state)
{
Object[] values = (Object[]) state;
_type = (ValueExpression) values[0];
_binding = (ValueExpression) values[1];
}
public Object saveState(FacesContext facesContext)
{
Object[] values = new Object[2];
values[0] = _type;
values[1] = _binding;
return values;
}
public void setTransient(boolean arg0)
{
// Do nothing
}
private ValueChangeListener _getDelegate() |
File | Line |
---|
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 673 |
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 747 |
CompositeComponentMetadataHandler handler = new CompositeComponentMetadataHandler(mngr, alias);
SAXParser parser = this.createSAXParser(handler);
parser.parse(is, handler);
}
catch (SAXException e)
{
throw new FaceletException("Error Parsing " + alias + ": " + e.getMessage(), e.getCause());
}
catch (ParserConfigurationException e)
{
throw new FaceletException("Error Configuring Parser " + alias + ": " + e.getMessage(), e.getCause());
}
finally
{
if (is != null)
{
is.close();
}
}
return new EncodingHandler(mngr.createFaceletHandler(), encoding);
} |
File | Line |
---|
org/apache/myfaces/application/jsp/JspStateManagerImpl.java | 818 |
org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java | 414 |
return serializedView;
}
/**
* Reads the value of the <code>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</code> context parameter.
* @see #SERIALIZE_STATE_IN_SESSION_PARAM
* @param context <code>FacesContext</code> for the request we are processing.
* @return boolean true, if the server state should be serialized in the session
*/
protected boolean isSerializeStateInSession(FacesContext context)
{
String value = context.getExternalContext().getInitParameter(
SERIALIZE_STATE_IN_SESSION_PARAM);
boolean serialize = DEFAULT_SERIALIZE_STATE_IN_SESSION;
if (value != null)
{
serialize = Boolean.valueOf(value);
}
return serialize;
}
/**
* Reads the value of the <code>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</code> context parameter.
* @see #COMPRESS_SERVER_STATE_PARAM
* @param context <code>FacesContext</code> for the request we are processing.
* @return boolean true, if the server state steam should be compressed
*/
protected boolean isCompressStateInSession(FacesContext context)
{
String value = context.getExternalContext().getInitParameter(
COMPRESS_SERVER_STATE_PARAM);
boolean compress = DEFAULT_COMPRESS_SERVER_STATE_PARAM;
if (value != null)
{
compress = Boolean.valueOf(value);
}
return compress;
}
protected Object deserializeView(Object state)
{
if (log.isLoggable(Level.FINEST)) |
File | Line |
---|
org/apache/myfaces/util/AbstractAttributeMap.java | 345 |
org/apache/myfaces/util/AbstractThreadSafeAttributeMap.java | 344 |
return AbstractThreadSafeAttributeMap.this.remove(((Entry<String, V>)o).getKey()) != null;
}
}
/**
* Not very efficient since it generates a new instance of <code>Entry</code> for each element and still internaly
* uses the <code>KeyIterator</code>. It is more efficient to use the <code>KeyIterator</code> directly.
*/
private final class EntryIterator extends AbstractAttributeIterator<Entry<String, V>>
{
@Override
protected Entry<String, V> getValue(final String attributeName)
{
// Must create new Entry every time--value of the entry must stay
// linked to the same attribute name
return new EntrySetEntry(attributeName);
}
}
private final class EntrySetEntry implements Entry<String, V>
{
private final String _currentKey;
public EntrySetEntry(final String currentKey)
{
_currentKey = currentKey;
}
public String getKey()
{
return _currentKey;
}
public V getValue()
{
return AbstractThreadSafeAttributeMap.this.get(_currentKey); |
File | Line |
---|
org/apache/myfaces/config/DefaultFacesConfigurationMerger.java | 393 |
org/apache/myfaces/config/DefaultFacesConfigurationMerger.java | 576 |
}
}
}
}
for (OrderSlot slot : resource.getOrdering().getAfterList())
{
if (slot instanceof FacesConfigNameSlot)
{
String name = ((FacesConfigNameSlot) slot).getName();
if (name != null && !"".equals(name))
{
boolean founded = false;
for (int j = i+1; j < sortedList.size(); j++)
{
if (name.equals(sortedList.get(j).getName()))
{
founded=true;
break;
}
}
if (founded)
{ |
File | Line |
---|
org/apache/myfaces/config/annotation/DefaultLifecycleProviderFactory.java | 164 |
org/apache/myfaces/config/annotation/DefaultLifecycleProviderFactory.java | 186 |
{
List<String> classList = ServiceProviderFinderFactory.getServiceProviderFinder(extContext).getServiceProviderList(LIFECYCLE_PROVIDER);
Iterator<String> iter = classList.iterator();
while (iter.hasNext())
{
String className = iter.next();
Object obj = createClass(className,extContext);
if (DiscoverableLifecycleProvider.class.isAssignableFrom(obj.getClass()))
{
DiscoverableLifecycleProvider discoverableLifecycleProvider = (DiscoverableLifecycleProvider) obj;
if (discoverableLifecycleProvider.isAvailable())
{
extContext.getApplicationMap().put(LIFECYCLE_PROVIDER_INSTANCE_KEY, discoverableLifecycleProvider);
return (Boolean) true;
}
}
} |
File | Line |
---|
org/apache/myfaces/util/AbstractAttributeMap.java | 107 |
org/apache/myfaces/util/AbstractThreadSafeAttributeMap.java | 103 |
}
@Override
public final V put(final String key, final V value)
{
final V retval = getAttribute(key);
setAttribute(key, value);
return retval;
}
@Override
public void putAll(final Map<? extends String, ? extends V> t)
{
for (final Entry<? extends String, ? extends V> entry : t.entrySet())
{
setAttribute(entry.getKey(), entry.getValue());
}
}
@Override
public final V remove(final Object key)
{
final String key_ = key.toString(); |
File | Line |
---|
org/apache/myfaces/el/unified/ResolverBuilderBase.java | 84 |
org/apache/myfaces/el/unified/ResolverBuilderBase.java | 107 |
facesContext.getExternalContext()).isSupportJSPAndFacesEL())
{
if (_config.getVariableResolver() != null)
{
resolvers.add(createELResolver(_config.getVariableResolver()));
}
else if (_config.getVariableResolverChainHead() != null)
{
resolvers.add(createELResolver(_config.getVariableResolverChainHead()));
}
if (_config.getPropertyResolver() != null)
{
resolvers.add(createELResolver(_config.getPropertyResolver()));
}
else if (_config.getPropertyResolverChainHead() != null)
{
resolvers.add(createELResolver(_config.getPropertyResolverChainHead()));
}
} |
File | Line |
---|
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 334 |
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 540 |
}
}
public void endEntity(String name) throws SAXException
{
}
public void endPrefixMapping(String prefix) throws SAXException
{
this.unit.popNamespace(prefix);
}
public void fatalError(SAXParseException e) throws SAXException
{
if (this.locator != null)
{
throw new SAXException("Error Traced[line: " + this.locator.getLineNumber() + "] " + e.getMessage());
}
else
{
throw e;
}
}
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
{
if (this.inDocument && inCompositeInterface) |
File | Line |
---|
org/apache/myfaces/config/annotation/AnnotationConfigurator.java | 223 |
org/apache/myfaces/config/annotation/AnnotationConfigurator.java | 451 |
log.finest ("addClientBehaviorRenderer(" + renderKitId + ", " + facesBehaviorRenderer.rendererType() + ", " +
clazz.getName() + ")");
}
org.apache.myfaces.config.impl.digester.elements.RenderKit renderKit =
(org.apache.myfaces.config.impl.digester.elements.RenderKit) facesConfig.getRenderKit(renderKitId);
if (renderKit == null)
{
renderKit = new org.apache.myfaces.config.impl.digester.elements.RenderKit();
facesConfig.addRenderKit(renderKit);
}
org.apache.myfaces.config.impl.digester.elements.ClientBehaviorRenderer cbr = |
File | Line |
---|
org/apache/myfaces/application/jsp/JspStateManagerImpl.java | 544 |
org/apache/myfaces/view/facelets/compiler/UILeaf.java | 247 |
StringBuffer intBuf = new StringBuffer();
intBuf.append("[Class: ");
intBuf.append(component.getClass().getName());
if (component instanceof UIViewRoot)
{
intBuf.append(",ViewId: ");
intBuf.append(((UIViewRoot) component).getViewId());
}
else
{
intBuf.append(",Id: ");
intBuf.append(component.getId());
}
intBuf.append("]");
buf.insert(0, intBuf.toString());
getPathToComponent(component.getParent(), buf);
} |
File | Line |
---|
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 141 |
org/apache/myfaces/view/facelets/compiler/SAXCompiler.java | 335 |
}
public void endEntity(String name) throws SAXException
{
}
public void endPrefixMapping(String prefix) throws SAXException
{
this.unit.popNamespace(prefix);
}
public void fatalError(SAXParseException e) throws SAXException
{
if (this.locator != null)
{
throw new SAXException("Error Traced[line: " + this.locator.getLineNumber() + "] " + e.getMessage());
}
else
{
throw e;
}
}
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
{
if (this.inDocument && inMetadata) |
File | Line |
---|
org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java | 290 |
org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java | 471 |
MetaRuleset m = new MetaRulesetImpl(_delegate.getTag(), type);
// ignore standard component attributes
m.ignore("binding").ignore("id");
// add auto wiring for attributes
m.addRule(ComponentRule.Instance);
// if it's an ActionSource
if (ActionSource.class.isAssignableFrom(type))
{
m.addRule(ActionSourceRule.Instance);
}
// if it's a ValueHolder
if (ValueHolder.class.isAssignableFrom(type))
{
m.addRule(ValueHolderRule.Instance);
// if it's an EditableValueHolder
if (EditableValueHolder.class.isAssignableFrom(type))
{
m.ignore("submittedValue");
m.ignore("valid");
m.addRule(EditableValueHolderRule.Instance);
}
}
return m;
} |
File | Line |
---|
org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java | 210 |
org/apache/myfaces/view/facelets/tag/composite/ImplementationHandler.java | 74 |
(CompositeComponentBeanInfo) compositeBaseParent.getAttributes()
.get(UIComponent.BEANINFO_KEY);
if (beanInfo == null)
{
if (log.isLoggable(Level.SEVERE))
{
log.severe("Cannot find composite bean descriptor UIComponent.BEANINFO_KEY ");
}
return;
}
BeanDescriptor beanDescriptor = beanInfo.getBeanDescriptor();
Map<String, PropertyDescriptor> facetPropertyDescriptorMap =
(Map<String, PropertyDescriptor>) beanDescriptor.getValue(UIComponent.FACETS_KEY);
if (facetPropertyDescriptorMap == null)
{
facetPropertyDescriptorMap = new HashMap<String, PropertyDescriptor>();
beanDescriptor.setValue(UIComponent.FACETS_KEY, facetPropertyDescriptorMap);
} |
File | Line |
---|
org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java | 97 |
org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java | 86 |
@JSFFaceletAttribute(name="displayName",
className="javax.el.ValueExpression",
deferredValueType="java.lang.String")
private final TagAttribute _displayName;
/**
* Indicate if the attribute is required or not
* <p>
* Myfaces specific feature: this attribute is checked only if project stage is
* not ProjectStage.Production when a composite component is created.
* </p>
*/
@JSFFaceletAttribute(name="required",
className="javax.el.ValueExpression",
deferredValueType="boolean")
private final TagAttribute _required;
/**
* Only available if ProjectStage is Development.
*/
@JSFFaceletAttribute(name="preferred",
className="javax.el.ValueExpression",
deferredValueType="boolean")
private final TagAttribute _preferred;
/**
* Only available if ProjectStage is Development.
*/
@JSFFaceletAttribute(name="expert",
className="javax.el.ValueExpression",
deferredValueType="boolean")
private final TagAttribute _expert;
/**
* Only available if ProjectStage is Development.
*/
@JSFFaceletAttribute(name="shortDescription",
className="javax.el.ValueExpression",
deferredValueType="java.lang.String")
private final TagAttribute _shortDescription;
/**
* The "hidden" flag is used to identify features that are intended only
* for tool use, and which should not be exposed to humans.
* Only available if ProjectStage is Development.
*/
@JSFFaceletAttribute(name="hidden", |
File | Line |
---|
org/apache/myfaces/taglib/core/ConverterImplTag.java | 128 |
org/apache/myfaces/taglib/core/DelegateConverter.java | 131 |
throw new ConverterException("Exception creating converter using binding", e);
}
}
if ((_converterId != null) || (_converterIdString != null))
{
try
{
if (null != _converterIdString)
{
converter = facesContext.getApplication().createConverter(_converterIdString);
} else
{
String converterId = (String) _converterId.getValue(elContext);
converter = facesContext.getApplication().createConverter(converterId);
}
// with binding no converter was created, set its value with the converter
// created using the converterId
if (converter != null && _binding != null)
{
_binding.setValue(elContext, converter);
}
}
catch (Exception e)
{
throw new ConverterException("Exception creating converter with converterId: " + _converterId, e); |