in src/main/java/com/netflix/imflibrary/MXFPropertyPopulator.java [489:555]
public static List<MXFUID> getDependentUIDs(InterchangeObject.InterchangeObjectBO interchangeObjectBO)
{
List<MXFUID> dependentUIDs = new ArrayList<>();
Class aClass = interchangeObjectBO.getClass();
while (aClass != null)
{
Field[] fields = aClass.getDeclaredFields();
for (Field field : fields)
{
field.setAccessible(true);
if (field.isAnnotationPresent(MXFProperty.class))
{
boolean depends = field.getAnnotation(MXFProperty.class).depends();
if (depends)
{
try
{
Object object = field.get(interchangeObjectBO);
if (object != null)
{
if (object instanceof CompoundDataTypes.MXFCollections.MXFCollection)
{
CompoundDataTypes.MXFCollections.MXFCollection<Object> collection = (CompoundDataTypes.MXFCollections.MXFCollection<Object>) object;
if(collection.getEntries().get(0) instanceof InterchangeObject.InterchangeObjectBO.StrongRef) {
CompoundDataTypes.MXFCollections.MXFCollection<InterchangeObject.InterchangeObjectBO.StrongRef> collectionStrongRefs = (CompoundDataTypes.MXFCollections.MXFCollection<InterchangeObject.InterchangeObjectBO.StrongRef>) object;
for (InterchangeObject.InterchangeObjectBO.StrongRef entry : collectionStrongRefs.getEntries()) {
dependentUIDs.add(entry.getInstanceUID());
}
}
else if(collection.getEntries().get(0) instanceof UL){
CompoundDataTypes.MXFCollections.MXFCollection<UL> collectionULs = (CompoundDataTypes.MXFCollections.MXFCollection<UL>) object;
for (UL entry : collectionULs.getEntries()) {
dependentUIDs.add(entry.getULAsMXFUid());
}
}
}
else if(object instanceof InterchangeObject.InterchangeObjectBO.StrongRef){
InterchangeObject.InterchangeObjectBO.StrongRef strongRef = (InterchangeObject.InterchangeObjectBO.StrongRef) object;
dependentUIDs.add(strongRef.getInstanceUID());
}
else if(object instanceof UL){
UL ul = (UL)object;
dependentUIDs.add(ul.getULAsMXFUid());
}
else
{
byte[] bytes = (byte[]) object;
dependentUIDs.add(new MXFUID(bytes));
}
}
}
catch(IllegalAccessException e)
{
throw new MXFException(e);
}
}
}
}
aClass = aClass.getSuperclass();
}
return dependentUIDs;
}