use of com.xpn.xwiki.objects.BaseProperty in project xwiki-platform by xwiki.
the class DefaultDocumentAccessBridge method getProperty.
@Override
public Object getProperty(DocumentReference documentReference, DocumentReference classReference, int objectNumber, String propertyName) {
Object value = null;
try {
XWikiContext xcontext = getContext();
if (xcontext != null && xcontext.getWiki() != null) {
XWikiDocument doc = xcontext.getWiki().getDocument(documentReference, xcontext);
BaseObject object = doc.getXObject(classReference, objectNumber);
if (object != null) {
BaseProperty property = (BaseProperty) object.get(propertyName);
if (property != null) {
value = property.getValue();
}
}
}
} catch (Exception e) {
this.logger.error("Failed to get property", e);
}
return value;
}
use of com.xpn.xwiki.objects.BaseProperty in project xwiki-platform by xwiki.
the class Property method getPropertyClass.
/**
* @return the definition of the property
* @since 8.3M1
*/
public PropertyClass getPropertyClass() {
BaseProperty baseProperty = getBaseProperty();
com.xpn.xwiki.objects.classes.PropertyClass propertyClass = baseProperty.getPropertyClass(getXWikiContext());
if (propertyClass != null) {
return new PropertyClass(propertyClass, getXWikiContext());
}
return null;
}
Aggregations