public ObjectReferenceType targetName(com.evolveum.prism.xml.ns._public.types_3.PolyStringType value) { setTargetName(value); return this; }
public static void copyToJAXB(REmbeddedNamedReference repo, ObjectReferenceType jaxb, PrismContext prismContext) { Validate.notNull(repo, "Repo object must not be null."); Validate.notNull(jaxb, "JAXB object must not be null."); REmbeddedReference.copyToJAXB(repo, jaxb, prismContext); jaxb.setTargetName(RPolyString.copyToJAXB(repo.getTargetName())); }
public static ObjectReferenceType createObjectRef(String oid, PolyStringType name, ObjectTypes type) { Validate.notEmpty(oid, "Oid must not be null or empty."); Validate.notNull(type, "Object type must not be null."); ObjectReferenceType reference = new ObjectReferenceType(); reference.setType(type.getTypeQName()); reference.setOid(oid); reference.setTargetName(name); return reference; }
public ObjectReferenceType toObjectReferenceType() { ObjectReferenceType retval = new ObjectReferenceType(); retval.setOid(oid); retval.setDescription(description); retval.setType(type); retval.setTargetName(fromOrig(targetName)); return retval; }
public static <O extends ObjectType> ObjectReferenceType createObjectReference(PrismObject<O> object, Class<? extends ObjectType> implicitReferenceTargetType) { ObjectReferenceType ref = new ObjectReferenceType(); ref.setOid(object.getOid()); if (implicitReferenceTargetType == null || !implicitReferenceTargetType.equals(object.getCompileTimeClass())) { ref.setType(ObjectTypes.getObjectType(object.getCompileTimeClass()).getTypeQName()); } ref.setTargetName(PolyString.toPolyStringType(object.getName())); return ref; }
public static <T extends ObjectType> ObjectReferenceType createObjectRef(PrismObject<T> object, QName relation) { if (object == null) { return null; } ObjectReferenceType ref = new ObjectReferenceType(); ref.setOid(object.getOid()); PrismObjectDefinition<T> definition = object.getDefinition(); if (definition != null) { ref.setType(definition.getTypeName()); } ref.setTargetName(object.asObjectable().getName()); ref.setRelation(relation); return ref; }
public ObjectReferenceType resolveObjectReferenceName(ObjectReferenceType ref, OperationResult result) { if (ref == null || ref.getTargetName() != null) { return ref; } PrismObject<?> object; if (ref.asReferenceValue().getObject() != null) { object = ref.asReferenceValue().getObject(); } else { object = resolveObjectReference(ref, result); if (object == null) { return ref; } } ref = ref.clone(); ref.setTargetName(PolyString.toPolyStringType(object.getName())); return ref; }
public static <T extends ObjectType> ObjectReferenceType createObjectRef(PrismReferenceValue refVal, boolean nameAsDescription) { if (refVal == null) { return null; } ObjectReferenceType ref = new ObjectReferenceType(); ref.setOid(refVal.getOid()); PrismObject<T> object = refVal.getObject(); if (object != null) { if (nameAsDescription) { ref.setDescription(object.getBusinessDisplayName()); } PrismObjectDefinition<T> definition = object.getDefinition(); if (definition != null) { ref.setType(definition.getTypeName()); } ref.setTargetName(PolyString.toPolyStringType(object.getName())); } else { ref.setType(refVal.getTargetType()); ref.setTargetName(PolyString.toPolyStringType(refVal.getTargetName())); if (nameAsDescription && refVal.getTargetName() != null) { ref.setDescription(refVal.getTargetName().getOrig()); } } return ref; }