Examples of XBELInternalAnnotationDefinition


Examples of org.openbel.bel.xbel.model.XBELInternalAnnotationDefinition

    public XBELInternalAnnotationDefinition convert(AnnotationDefinition t) {
        if (t == null || t.getURL() != null) {
            return null;
        }

        XBELInternalAnnotationDefinition dest =
                new XBELInternalAnnotationDefinition();

        String description = t.getDescription();
        String id = t.getId();
        String usage = t.getUsage();
        // If null, set equal to an empty string so that the document can be properly converted.
        if (description == null) description = "";
        if (usage == null) usage = "";

        dest.setDescription(description);
        dest.setId(id);
        dest.setUsage(usage);

        AnnotationType type = t.getType();
        String value = t.getValue();

        switch (type) {
        case ENUMERATION:
            List<String> enums = t.getEnums();
            XBELListAnnotation xla = new XBELListAnnotation();
            List<String> xlaval = xla.getListValue();
            xlaval.addAll(enums);
            dest.setListAnnotation(xla);
            break;
        case REGULAR_EXPRESSION:
            dest.setPatternAnnotation(value);
            break;
        default:
            throw new UnsupportedOperationException("unknown type: " + type);
        }
View Full Code Here

Examples of org.openbel.bel.xbel.model.XBELInternalAnnotationDefinition

            ExternalAnnotationDefinitionConverter eConverter =
                    new ExternalAnnotationDefinitionConverter();

            for (final AnnotationDefinition ad : definitions) {

                XBELInternalAnnotationDefinition iad = iConverter.convert(ad);
                if (iad != null) {
                    internals.add(iad);
                    continue;
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.