@Override
    public Statement convert(BELStatement bs) {
        if (bs == null) {
            return null;
        }

        String comment = bs.getComment();
        String belSyntax = bs.getStatementSyntax();

        Statement s = BELParser.parseStatement(belSyntax);
        repopulateNamespaces(s);

        s.setComment(comment);

        final BELAnnotationConverter bac =
                new BELAnnotationConverter(adefs);
        List<BELAnnotation> annotations = bs.getAnnotations();
        List<Annotation> alist = null;
        if (hasItems(annotations)) {
            alist = sizedArrayList(annotations.size());
            for (BELAnnotation annotation : annotations) {
                alist.addAll(bac.convert(annotation));
            }
        }

        BELCitation bc = bs.getCitation();
        BELEvidence be = bs.getEvidence();

        AnnotationGroup ag = new AnnotationGroup();
        boolean hasAnnotation = false;
        if (hasItems(alist)) {
            ag.setAnnotations(alist);
            hasAnnotation = true;
        }

        if (bc != null) {
            ag.setCitation(bcc.convert(bc));
            hasAnnotation = true;
        }

        if (be != null) {
            ag.setEvidence(bec.convert(be));
            hasAnnotation = true;
        }

        if (hasAnnotation) {
            s.setAnnotationGroup(ag);
        }

        return s;
    }
@ Override public Statement convert ( BELStatement bs ) { if ( bs == null ) { return null ; } String comment = bs . getComment ( ) ; String belSyntax = bs . getStatementSyntax ( ) ; Statement s = BELParser . parseStatement ( belSyntax ) ; repopulateNamespaces ( s ) ; s . setComment ( comment ) ; final BELAnnotationConverter bac = new BELAnnotationConverter ( adefs ) ; List < BELAnnotation > annotations = bs . getAnnotations ( ) ; List < Annotation > alist = null ; if ( hasItems ( annotations ) ) { alist = sizedArrayList ( annotations . size ( ) ) ; for ( BELAnnotation annotation : annotations ) { alist . addAll ( bac . convert ( annotation ) ) ; } } BELCitation bc = bs . getCitation ( ) ; BELEvidence be = bs . getEvidence ( ) ; AnnotationGroup ag = new AnnotationGroup ( ) ; boolean hasAnnotation = false ; if ( hasItems ( alist ) ) { ag . setAnnotations ( alist ) ; hasAnnotation = true ; } if ( bc != null ) { ag . setCitation ( bcc . convert ( bc ) ) ; hasAnnotation = true ; } if ( be != null ) { ag . setEvidence ( bec . convert ( be ) ) ; hasAnnotation = true ; } if ( hasAnnotation ) { s . setAnnotationGroup ( ag ) ; } return s ; }
{@inheritDoc}