/** * {@inheritDoc} * * @see com.xpn.xwiki.objects.ObjectInterface#get(java.lang.String) */ public PropertyInterface get(String name) throws XWikiException { return safeget(name); }
@Override public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) { ElementInterface prop = object.safeget(name); if (prop != null) { buffer.append(FORM_PASSWORD_PLACEHODLER); } }
public void removeField(String name) { Object field = safeget(name); if (field != null) { this.fields.remove(name); this.fieldsToRemove.add(field); } }
public List getListValue(String name) { ListProperty prop = (ListProperty) safeget(name); if (prop == null) { return new ArrayList(); } else { return (List) prop.getValue(); } }
public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) { BaseProperty prop = (BaseProperty) object.safeget(name); if (prop != null) { buffer.append(prop.toText()); } }
@Override public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) { BaseProperty prop = (BaseProperty) object.safeget(name); buffer.append(toFormString(prop)); }
public Set< ? > getSetValue(String name) { ListProperty prop = (ListProperty) safeget(name); if (prop == null) { return new HashSet<Object>(); } else { return new HashSet<Object>((Collection< ? >) prop.getValue()); } }
public Date getDateValue(String name) { try { DateProperty prop = (DateProperty) safeget(name); if (prop == null) { return null; } else { return (Date) prop.getValue(); } } catch (Exception e) { return null; } }
public float getFloatValue(String name) { try { NumberProperty prop = (NumberProperty) safeget(name); if (prop == null) { return 0; } else { return ((Number) prop.getValue()).floatValue(); } } catch (Exception e) { return 0; } }
public int getIntValue(String name, int default_value) { try { NumberProperty prop = (NumberProperty) safeget(name); if (prop == null) { return default_value; } else { return ((Number) prop.getValue()).intValue(); } } catch (Exception e) { return default_value; } }
public double getDoubleValue(String name) { try { NumberProperty prop = (NumberProperty) safeget(name); if (prop == null) { return 0; } else { return ((Number) prop.getValue()).doubleValue(); } } catch (Exception e) { return 0; } }
public long getLongValue(String name) { try { NumberProperty prop = (NumberProperty) safeget(name); if (prop == null) { return 0; } else { return ((Number) prop.getValue()).longValue(); } } catch (Exception e) { return 0; } }
@Override public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) { IntegerProperty prop = (IntegerProperty) object.safeget(name); if (prop == null) { return; } Integer iValue = (Integer) prop.getValue(); if (iValue != null) { int value = iValue.intValue(); buffer.append(getDisplayValue(context, value)); } }
public String getStringValue(String name) { BaseProperty prop = (BaseProperty) safeget(name); if (prop == null || prop.getValue() == null) { return ""; } else { return prop.getValue().toString(); } }
public void merge(BaseObject object) { Iterator itfields = object.getPropertyList().iterator(); while (itfields.hasNext()) { String name = (String) itfields.next(); if (safeget(name) == null) { safeput(name, (PropertyInterface) ((BaseElement) object.safeget(name)).clone()); } } }
public void setStringListValue(String name, List value) { ListProperty property = (ListProperty) safeget(name); if (property == null) { property = new StringListProperty(); } property.setValue(value); safeput(name, property); }
public void setDBStringListValue(String name, List value) { ListProperty property = (ListProperty) safeget(name); if (property == null) { property = new DBStringListProperty(); } property.setValue(value); safeput(name, property); }
public void setLargeStringValue(String name, String value) { BaseStringProperty property = (BaseStringProperty) safeget(name); if (property == null) { property = new LargeStringProperty(); } property.setName(name); property.setValue(value); safeput(name, property); }
public void setStringValue(String name, String value) { BaseStringProperty property = (BaseStringProperty) safeget(name); if (property == null) { property = new StringProperty(); } property.setName(name); property.setValue(value); safeput(name, property); }
public void displayEdit(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) { input input = new input(); BaseProperty prop = (BaseProperty) object.safeget(name); if (prop != null) { input.setValue(prop.toFormString()); } input.setType("text"); input.setName(prefix + name); input.setID(prefix + name); input.setDisabled(isDisabled()); buffer.append(input.toString()); }