Skip to content

Commit

Permalink
Convert AnnotationRefs on Annotations
Browse files Browse the repository at this point in the history
See #9541.
  • Loading branch information
melissalinkert committed Sep 10, 2012
1 parent f49d0e5 commit 28ea8a2
Showing 1 changed file with 130 additions and 0 deletions.
130 changes: 130 additions & 0 deletions components/scifio/src/loci/formats/meta/MetadataConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ private static void convertBooleanAnnotations(MetadataRetrieve src,
dest.setBooleanAnnotationValue(value, i);
}
catch (NullPointerException e) { }

int annotationRefCount = 0;
try {
annotationRefCount = src.getBooleanAnnotationAnnotationCount(i);
}
catch (NullPointerException e) { }
for (int a=0; a<annotationRefCount; a++) {
try {
String id = src.getBooleanAnnotationAnnotationRef(i, a);
dest.setBooleanAnnotationAnnotationRef(id, i, a);
}
catch (NullPointerException e) { }
}
}
}

Expand Down Expand Up @@ -167,6 +180,19 @@ private static void convertCommentAnnotations(MetadataRetrieve src,
dest.setCommentAnnotationValue(value, i);
}
catch (NullPointerException e) { }

int annotationRefCount = 0;
try {
annotationRefCount = src.getCommentAnnotationAnnotationCount(i);
}
catch (NullPointerException e) { }
for (int a=0; a<annotationRefCount; a++) {
try {
String id = src.getCommentAnnotationAnnotationRef(i, a);
dest.setCommentAnnotationAnnotationRef(id, i, a);
}
catch (NullPointerException e) { }
}
}
}

Expand Down Expand Up @@ -270,6 +296,19 @@ private static void convertDoubleAnnotations(MetadataRetrieve src,
dest.setDoubleAnnotationValue(value, i);
}
catch (NullPointerException e) { }

int annotationRefCount = 0;
try {
annotationRefCount = src.getDoubleAnnotationAnnotationCount(i);
}
catch (NullPointerException e) { }
for (int a=0; a<annotationRefCount; a++) {
try {
String id = src.getDoubleAnnotationAnnotationRef(i, a);
dest.setDoubleAnnotationAnnotationRef(id, i, a);
}
catch (NullPointerException e) { }
}
}
}

Expand Down Expand Up @@ -564,6 +603,19 @@ private static void convertFileAnnotations(MetadataRetrieve src,
dest.setBinaryFileSize(fileSize, i);
}
catch (NullPointerException e) { }

int annotationRefCount = 0;
try {
annotationRefCount = src.getFileAnnotationAnnotationCount(i);
}
catch (NullPointerException e) { }
for (int a=0; a<annotationRefCount; a++) {
try {
String id = src.getFileAnnotationAnnotationRef(i, a);
dest.setFileAnnotationAnnotationRef(id, i, a);
}
catch (NullPointerException e) { }
}
}
}

Expand Down Expand Up @@ -1585,6 +1637,19 @@ private static void convertListAnnotations(MetadataRetrieve src,
dest.setListAnnotationNamespace(namespace, i);
}
catch (NullPointerException e) { }

int annotationRefCount = 0;
try {
annotationRefCount = src.getListAnnotationAnnotationCount(i);
}
catch (NullPointerException e) { }
for (int a=0; a<annotationRefCount; a++) {
try {
String id = src.getListAnnotationAnnotationRef(i, a);
dest.setListAnnotationAnnotationRef(id, i, a);
}
catch (NullPointerException e) { }
}
}
}

Expand Down Expand Up @@ -1622,6 +1687,19 @@ private static void convertLongAnnotations(MetadataRetrieve src,
dest.setLongAnnotationValue(value, i);
}
catch (NullPointerException e) { }

int annotationRefCount = 0;
try {
annotationRefCount = src.getLongAnnotationAnnotationCount(i);
}
catch (NullPointerException e) { }
for (int a=0; a<annotationRefCount; a++) {
try {
String id = src.getLongAnnotationAnnotationRef(i, a);
dest.setLongAnnotationAnnotationRef(id, i, a);
}
catch (NullPointerException e) { }
}
}
}

Expand Down Expand Up @@ -3213,6 +3291,19 @@ private static void convertTagAnnotations(MetadataRetrieve src,
dest.setTagAnnotationValue(value, i);
}
catch (NullPointerException e) { }

int annotationRefCount = 0;
try {
annotationRefCount = src.getTagAnnotationAnnotationCount(i);
}
catch (NullPointerException e) { }
for (int a=0; a<annotationRefCount; a++) {
try {
String id = src.getTagAnnotationAnnotationRef(i, a);
dest.setTagAnnotationAnnotationRef(id, i, a);
}
catch (NullPointerException e) { }
}
}
}

Expand Down Expand Up @@ -3250,6 +3341,19 @@ private static void convertTermAnnotations(MetadataRetrieve src,
dest.setTermAnnotationValue(value, i);
}
catch (NullPointerException e) { }

int annotationRefCount = 0;
try {
annotationRefCount = src.getTermAnnotationAnnotationCount(i);
}
catch (NullPointerException e) { }
for (int a=0; a<annotationRefCount; a++) {
try {
String id = src.getTermAnnotationAnnotationRef(i, a);
dest.setTermAnnotationAnnotationRef(id, i, a);
}
catch (NullPointerException e) { }
}
}
}

Expand Down Expand Up @@ -3287,6 +3391,19 @@ private static void convertTimestampAnnotations(MetadataRetrieve src,
dest.setTimestampAnnotationValue(value, i);
}
catch (NullPointerException e) { }

int annotationRefCount = 0;
try {
annotationRefCount = src.getTimestampAnnotationAnnotationCount(i);
}
catch (NullPointerException e) { }
for (int a=0; a<annotationRefCount; a++) {
try {
String id = src.getTimestampAnnotationAnnotationRef(i, a);
dest.setTimestampAnnotationAnnotationRef(id, i, a);
}
catch (NullPointerException e) { }
}
}
}

Expand Down Expand Up @@ -3324,6 +3441,19 @@ private static void convertXMLAnnotations(MetadataRetrieve src,
dest.setXMLAnnotationValue(value, i);
}
catch (NullPointerException e) { }

int annotationRefCount = 0;
try {
annotationRefCount = src.getXMLAnnotationAnnotationCount(i);
}
catch (NullPointerException e) { }
for (int a=0; a<annotationRefCount; a++) {
try {
String id = src.getXMLAnnotationAnnotationRef(i, a);
dest.setXMLAnnotationAnnotationRef(id, i, a);
}
catch (NullPointerException e) { }
}
}
}

Expand Down

0 comments on commit 28ea8a2

Please sign in to comment.