File | Line |
---|
org/apache/myfaces/commons/converter/ConverterBase.java | 146 |
org/apache/myfaces/commons/converter/DateTimeConverter.java | 241 |
}
// --------------------- borrowed from UIComponentBase ------------
private Map _valueBindingMap = null;
public ValueBinding getValueBinding(String name)
{
if (name == null) throw new NullPointerException("name");
if (_valueBindingMap == null)
{
return null;
}
else
{
return (ValueBinding)_valueBindingMap.get(name);
}
}
public void setValueBinding(String name,
ValueBinding binding)
{
if (name == null) throw new NullPointerException("name");
if (_valueBindingMap == null)
{
_valueBindingMap = new HashMap();
}
_valueBindingMap.put(name, binding);
}
private Object saveValueBindingMap(FacesContext context)
{
if (_valueBindingMap != null)
{
int initCapacity = (_valueBindingMap.size() * 4 + 3) / 3;
HashMap stateMap = new HashMap(initCapacity);
for (Iterator it = _valueBindingMap.entrySet().iterator(); it.hasNext(); )
{
Map.Entry entry = (Map.Entry)it.next();
stateMap.put(entry.getKey(), |
File | Line |
---|
org/apache/myfaces/commons/converter/_LocaleRule.java | 32 |
org/apache/myfaces/commons/converter/_TimeZoneRule.java | 32 |
final class _TimeZoneRule extends MetaRule {
final static class ValueBindingMetadata extends Metadata {
private final String name;
private final TagAttribute attr;
private final Class type;
public ValueBindingMetadata(String name, Class type,
TagAttribute attr) {
this.name = name;
this.attr = attr;
this.type = type;
}
public void applyMetadata(FaceletContext ctx, Object instance) {
((ConverterBase) instance).setValueBinding(this.name, new LegacyValueBinding(this.attr
.getValueExpression(ctx, this.type)));
}
}
final static class LiteralPropertyMetadata extends Metadata
{
private final Method method;
private final TagAttribute attribute;
private Object[] value;
public LiteralPropertyMetadata(Method method, TagAttribute attribute)
{
this.method = method;
this.attribute = attribute;
}
public void applyMetadata(FaceletContext ctx, Object instance)
{
if (value == null)
{
String str = this.attribute.getValue();
value = new Object[] { java.util.TimeZone.getTimeZone( str ) }; |
File | Line |
---|
org/apache/myfaces/commons/converter/ConverterBase.java | 186 |
org/apache/myfaces/commons/converter/DateTimeConverter.java | 281 |
ConverterBase.saveAttachedState(context, entry.getValue()));
}
return stateMap;
}
else
{
return null;
}
}
private void restoreValueBindingMap(FacesContext context, Object stateObj)
{
if (stateObj != null)
{
Map stateMap = (Map)stateObj;
int initCapacity = (stateMap.size() * 4 + 3) / 3;
_valueBindingMap = new HashMap(initCapacity);
for (Iterator it = stateMap.entrySet().iterator(); it.hasNext(); )
{
Map.Entry entry = (Map.Entry)it.next();
_valueBindingMap.put(entry.getKey(), |
File | Line |
---|
org/apache/myfaces/commons/converter/AbstractTypedNumberConverter.java | 462 |
org/apache/myfaces/commons/converter/DateTimeConverter.java | 365 |
public Locale getLocale()
{
if (_locale != null)
{
return _locale;
}
ValueBinding vb = getValueBinding("locale");
if (vb != null)
{
Object _localeValue = vb.getValue(getFacesContext());
if (_localeValue instanceof String)
{
_localeValue = org.apache.myfaces.commons.util.TagUtils.getLocale((String)_localeValue);
}
return (java.util.Locale)_localeValue;
}
FacesContext context = FacesContext.getCurrentInstance();
return context.getViewRoot().getLocale();
}
public void setLocale(Locale locale)
{
_locale = locale;
}
/**
* A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.
*
*/
@JSFProperty(inheritedTag = false) |