Package org.openbel.framework.common.model

Examples of org.openbel.framework.common.model.AnnotationDefinition


        String desc = t.getDescription();
        String id = t.getId();
        String use = t.getUsage();

        AnnotationDefinition dest = null;
        if (t.isSetListAnnotation()) {
            XBELListAnnotation listAnnotation = t.getListAnnotation();
            List<String> vals = listAnnotation.getListValue();
            dest = new AnnotationDefinition(id, desc, use, vals);
        } else if (t.isSetPatternAnnotation()) {
            String regex = t.getPatternAnnotation();
            dest = new AnnotationDefinition(id, REGULAR_EXPRESSION, desc, use);
            dest.setValue(regex);
        } else {
            throw new UnsupportedOperationException("unhandled");
        }

        return dest;
View Full Code Here


        if (source == null) return null;

        String refID = source.getRefID();
        String value = source.getValue();

        final AnnotationDefinition ad = CommonModelFactory.getInstance()
                .createAnnotationDefinition(refID,
                        UNRESOLVED_ANNOTATION_DEFINITION_TYPE,
                        UNRESOLVED_ANNOTATION_DEFINITION_DESCRIPTION,
                        UNRESOLVED_ANNOTATION_DEFINITION_USAGE,
                        UNRESOLVED_ANNOTATION_DEFINITION_VALUE);
View Full Code Here

     */
    @Override
    public XBELAnnotation convert(Annotation source) {
        if (source == null) return null;

        AnnotationDefinition definition = source.getDefinition();
        String refID = definition.getId();
        String value = source.getValue();

        XBELAnnotation xa = new XBELAnnotation();
        xa.setRefID(refID);
        xa.setValue(value);
View Full Code Here

                try {
                    if (verbose) {
                        reportable.output("Resolving Annotation Definition: "
                                + url);
                    }
                    AnnotationDefinition external =
                            annoDefService.resolveAnnotationDefinition(url);
                    annodef.setDescription(external.getDescription());
                    annodef.setEnums(external.getEnums());
                    annodef.setType(external.getType());
                    annodef.setURL(external.getURL());
                    annodef.setUsage(external.getUsage());
                    annodef.setValue(external.getValue());
                } catch (AnnotationDefinitionResolutionException e) {
                    adFailures++;
                    if (!quiet) {
                        if (permissive) {
                            reportable.warning(e.getUserFacingMessage());
View Full Code Here

            if (url == null) {
                resolved.add(annodef);
                continue;
            }

            AnnotationDefinition ad;
            try {
                ad = annotationDefinition.resolveAnnotationDefinition(url);
                annodef.setType(ad.getType());
                annodef.setDescription(ad.getDescription());
                annodef.setUsage(ad.getUsage());
                annodef.setEnums(ad.getEnums());
                annodef.setValue(ad.getValue());

                resolved.add(annodef);
            } catch (AnnotationDefinitionResolutionException e) {
                ad = getInstance().createAnnotationDefinition(annodef.getId());
                ad.setType(ENUMERATION);
                List<String> enums = emptyList();
                ad.setEnums(enums);
                resolved.add(ad);
                output.addResolutionException(e);
            }
        }
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.model.AnnotationDefinition

Copyright © 2018 www.massapicom. 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.