Package org.openbel.framework.common

Examples of org.openbel.framework.common.AnnotationDefinitionResolutionException


        ResolvedResource resolveResource;
        try {
            resolveResource = resourceCache.resolveResource(
                    ANNOTATIONS, resourceLocation);
        } catch (ResourceDownloadError e) {
            throw new AnnotationDefinitionResolutionException(resourceLocation,
                    e.getMessage());
        }
        File annotationCacheCopy = resolveResource.getCacheResourceCopy();

        CachedResource cacheResource = cacheLookupService.findInCache(
                ANNOTATIONS, resourceLocation);

        AnnotationHeaderProcessor annotationHeaderProcessor =
                new AnnotationHeaderProcessor();

        AnnotationHeader annotationHeader;
        try {
            annotationHeader =
                    annotationHeaderProcessor
                            .processAnnotationHeader(resourceLocation,
                                    annotationCacheCopy,
                                    cacheResource
                                            .getLocalFile());
        } catch (IndexingFailure e) {
            throw new AnnotationDefinitionResolutionException(resourceLocation,
                    e.getMessage());
        }

        AnnotationDefinition annotationDefinition = CommonModelFactory
                .getInstance().createAnnotationDefinition(annotationHeader.
                        getAnnotationBlock().getKeyword());
        annotationDefinition.setDescription(annotationHeader
                .getAnnotationBlock().getDescriptionString());
        annotationDefinition.setUsage(annotationHeader.getAnnotationBlock()
                .getUsageString());
        annotationDefinition.setType(annotationHeader.getAnnotationBlock()
                .getAnnotationType());
        annotationDefinition.setURL(resourceLocation);

        long characterOffset = annotationHeaderProcessor
                .getCharacterStopOffset();

        try {
            switch (annotationDefinition.getType()) {
            case ENUMERATION:
                annotationDefinition.setEnums(parseEnumData(
                        annotationCacheCopy,
                        annotationHeader.getProcessingBlock()
                                .getDelimiterString(),
                        characterOffset));
                break;
            case REGULAR_EXPRESSION:
                annotationDefinition.setValue(parseRegularExpression(
                        annotationCacheCopy, characterOffset));
            }
        } catch (IOException e) {
            throw new AnnotationDefinitionResolutionException(resourceLocation,
                    e.getMessage());
        }

        return annotationDefinition;
    }
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.AnnotationDefinitionResolutionException

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.