use of org.osate.ge.businessobjecthandling.ReferenceContext in project osate2 by osate.
the class DefaultReferenceService method getRelativeReference.
@Override
public RelativeBusinessObjectReference getRelativeReference(final Object bo) {
Objects.requireNonNull(bo, "bo must not be null");
final BusinessObjectHandler boh = bohProvider.getApplicableBusinessObjectHandler(bo);
if (boh == null) {
return null;
}
try {
return Objects.requireNonNull(boh.getRelativeReference(new ReferenceContext(bo, this)), () -> "Business object handlers must not return a null relative reference. Null reference returned by '" + boh.getClass().getCanonicalName() + "'");
} catch (RuntimeException ex) {
StatusManager.getManager().handle(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Error retrieving relative reference for " + bo.getClass().getCanonicalName() + ".", ex), StatusManager.LOG | StatusManager.SHOW);
return null;
}
}
use of org.osate.ge.businessobjecthandling.ReferenceContext in project osate2 by osate.
the class DefaultReferenceService method getCanonicalReference.
@Override
public CanonicalBusinessObjectReference getCanonicalReference(final Object bo) {
Objects.requireNonNull(bo, "bo must not be null");
final BusinessObjectHandler boh = bohProvider.getApplicableBusinessObjectHandler(bo);
if (boh == null) {
return null;
}
try {
return boh.getCanonicalReference(new ReferenceContext(bo, this));
} catch (RuntimeException ex) {
StatusManager.getManager().handle(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Error retrieving canonical reference for " + bo.getClass().getCanonicalName() + ".", ex), StatusManager.LOG | StatusManager.SHOW);
return null;
}
}
Aggregations