当前位置: 首页>>代码示例>>Java>>正文


Java Store.create方法代码示例

本文整理汇总了Java中com.buschmais.jqassistant.core.store.api.Store.create方法的典型用法代码示例。如果您正苦于以下问题:Java Store.create方法的具体用法?Java Store.create怎么用?Java Store.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.buschmais.jqassistant.core.store.api.Store的用法示例。


在下文中一共展示了Store.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: scan

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
@Override
public ManifestFileDescriptor scan(FileResource item, String path, Scope scope, Scanner scanner) throws IOException {
    try (InputStream stream = item.createStream()) {
        Manifest manifest = new Manifest(stream);
        ScannerContext context = scanner.getContext();
        Store store = context.getStore();
        FileDescriptor fileDescriptor = context.getCurrentDescriptor();
        ManifestFileDescriptor manifestFileDescriptor = store.addDescriptorType(fileDescriptor, ManifestFileDescriptor.class);
        ManifestSectionDescriptor mainSectionDescriptor = store.create(ManifestSectionDescriptor.class);
        mainSectionDescriptor.setName(SECTION_MAIN);
        manifestFileDescriptor.setMainSection(mainSectionDescriptor);
        readSection(manifest.getMainAttributes(), mainSectionDescriptor, store);
        for (Map.Entry<String, Attributes> sectionEntry : manifest.getEntries().entrySet()) {
            ManifestSectionDescriptor sectionDescriptor = store.create(ManifestSectionDescriptor.class);
            sectionDescriptor.setName(sectionEntry.getKey());
            readSection(sectionEntry.getValue(), sectionDescriptor, store);
            manifestFileDescriptor.getManifestSections().add(sectionDescriptor);
        }
        return manifestFileDescriptor;
    }
}
 
开发者ID:buschmais,项目名称:jqa-java-plugin,代码行数:22,代码来源:ManifestFileScannerPlugin.java

示例2: scan

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
@Override
public PropertyFileDescriptor scan(FileResource item, String path, Scope scope, Scanner scanner) throws IOException {
    ScannerContext context = scanner.getContext();
    Store store = context.getStore();
    FileDescriptor fileDescriptor = context.getCurrentDescriptor();
    PropertyFileDescriptor propertyFileDescriptor = store.addDescriptorType(fileDescriptor, PropertyFileDescriptor.class);
    Properties properties = new Properties();
    try (InputStream stream = item.createStream()) {
        properties.load(stream);
    } catch (IllegalArgumentException e) {
        LOGGER.warn("Cannot load properties from '" + path + "': " + e.getMessage());
    }
    for (String name : properties.stringPropertyNames()) {
        String value = properties.getProperty(name);
        PropertyDescriptor propertyDescriptor = store.create(PropertyDescriptor.class);
        propertyDescriptor.setName(name);
        propertyDescriptor.setValue(value);
        propertyFileDescriptor.getProperties().add(propertyDescriptor);
    }
    return propertyFileDescriptor;
}
 
开发者ID:buschmais,项目名称:jqa-java-plugin,代码行数:22,代码来源:PropertyFileScannerPlugin.java

示例3: scan

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
@Override
public PropertyFileDescriptor scan(FileResource item, String path, Scope scope, Scanner scanner) throws IOException {
    ScannerContext context = scanner.getContext();
    Store store = context.getStore();
    FileDescriptor fileDescriptor = context.getCurrentDescriptor();
    Class<XmlPropertyFileDescriptor> descriptorType = XmlPropertyFileDescriptor.class;
    PropertyFileDescriptor propertyFileDescriptor = store.addDescriptorType(fileDescriptor, descriptorType);
    Properties properties = new Properties();
    try (InputStream stream = item.createStream()) {
        properties.loadFromXML(stream);
    } catch (IllegalArgumentException e) {
        LOGGER.warn("Cannot load properties from '" + path + "': " + e.getMessage());
    }

    for (String name : properties.stringPropertyNames()) {
        String value = properties.getProperty(name);
        PropertyDescriptor propertyDescriptor = store.create(PropertyDescriptor.class);
        propertyDescriptor.setName(name);
        propertyDescriptor.setValue(value);
        propertyFileDescriptor.getProperties().add(propertyDescriptor);
    }
    return propertyFileDescriptor;
}
 
开发者ID:buschmais,项目名称:jqa-java-plugin,代码行数:24,代码来源:XmlPropertyFileScannerPlugin.java

示例4: scan

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
@Override
public PlaintextFileDescriptor scan(final FileResource item, final String path, final Scope scope, final Scanner scanner) throws IOException {
    final Store store = scanner.getContext().getStore();
    final PlaintextFileDescriptor plaintextFileDescriptor = store.create(PlaintextFileDescriptor.class);
    plaintextFileDescriptor.setFileName(path);

    try (BufferedReader reader = new BufferedReader(new InputStreamReader(item.createStream()))) {
        final PlaintextLineParser pumlLineParser = new PlaintextLineParser(store, plaintextFileDescriptor);
        String line;
        while ((line = reader.readLine()) != null) {
            pumlLineParser.parseLine(line);
        }
    }

    return plaintextFileDescriptor;
}
 
开发者ID:kontext-e,项目名称:jqassistant-plugins,代码行数:17,代码来源:PlaintextFileScannerPlugin.java

示例5: scan

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
@Override
public PlantUmlFileDescriptor scan(final FileResource item, final String path, final Scope scope, final Scanner scanner) throws IOException {
    final Store store = scanner.getContext().getStore();
    final PlantUmlFileDescriptor plantUmlFileDescriptor = store.create(PlantUmlFileDescriptor.class);
    plantUmlFileDescriptor.setFileName(path);

    try (BufferedReader reader = new BufferedReader(new InputStreamReader(item.createStream()))) {
        final PumlLineParser pumlLineParser = new PumlLineParser(store, plantUmlFileDescriptor, path.endsWith(".puml") ? ParsingState.ACCEPTING : ParsingState.IGNORING);
        String line;
        while ((line = reader.readLine()) != null) {
            pumlLineParser.parseLine(line);
        }
    }

    return plantUmlFileDescriptor;
}
 
开发者ID:kontext-e,项目名称:jqassistant-plugins,代码行数:17,代码来源:PlantUmlFileScannerPlugin.java

示例6: readViolations

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
private void readViolations(final Store store, final FileType fileType, final PmdFileDescriptor pmdFileDescriptor) {
     for (ViolationType vioType : fileType.getViolation()) {
         final PmdViolationDescriptor vioDescriptor = store.create(PmdViolationDescriptor.class);
vioDescriptor.setBeginLine(vioType.getBeginline());
vioDescriptor.setEndLine(vioType.getEndline());
vioDescriptor.setBeginColumn(vioType.getBegincolumn());
vioDescriptor.setEndColumn(vioType.getEndcolumn());
         vioDescriptor.setRule(vioType.getRule());
         vioDescriptor.setRuleSet(vioType.getRuleset());
         vioDescriptor.setPackage(vioType.get_package());
         vioDescriptor.setClassName(vioType.getClazz());
vioDescriptor.setMethod(vioType.getMethod());
vioDescriptor.setVariable(vioType.getVariable());
vioDescriptor.setExternalInfoUrl(vioType.getExternalInfoUrl());
vioDescriptor.setPriority(vioType.getPriority());
vioDescriptor.setMessage(vioType.getValue());
         pmdFileDescriptor.getViolations().add(vioDescriptor);
     }
 }
 
开发者ID:kontext-e,项目名称:jqassistant-plugins,代码行数:20,代码来源:PmdReportScannerPlugin.java

示例7: readSection

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
private void readSection(Attributes attributes, ManifestSectionDescriptor sectionDescriptor, Store store) {
    for (Map.Entry<Object, Object> entry : attributes.entrySet()) {
        Object key = entry.getKey();
        Object value = entry.getValue();
        ManifestEntryDescriptor entryDescriptor = store.create(ManifestEntryDescriptor.class);
        entryDescriptor.setName(key != null ? key.toString() : null);
        entryDescriptor.setValue(value != null ? value.toString() : null);
        sectionDescriptor.getManifestEntries().add(entryDescriptor);
    }
}
 
开发者ID:buschmais,项目名称:jqa-java-plugin,代码行数:11,代码来源:ManifestFileScannerPlugin.java

示例8: getContainerDescriptor

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
@Override
protected JavaClassesDirectoryDescriptor getContainerDescriptor(File classPathDirectory, ScannerContext scannerContext) {
    JavaArtifactFileDescriptor javaArtifactDescriptor = scannerContext.peekOrDefault(JavaArtifactFileDescriptor.class, null);
    Store store = scannerContext.getStore();
    if (javaArtifactDescriptor == null) {
        return store.create(JavaClassesDirectoryDescriptor.class);
    }
    if (JavaClassesDirectoryDescriptor.class.isAssignableFrom(javaArtifactDescriptor.getClass())) {
        return JavaClassesDirectoryDescriptor.class.cast(javaArtifactDescriptor);
    }
    throw new IllegalStateException("Expected an instance of " + JavaClassesDirectoryDescriptor.class.getName() + " but got "
            + Arrays.asList(javaArtifactDescriptor.getClass().getInterfaces()));
}
 
开发者ID:buschmais,项目名称:jqa-java-plugin,代码行数:14,代码来源:JavaClassesDirectoryScannerPlugin.java

示例9: getMavenRepoDescriptor

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
private MavenRepositoryDescriptor getMavenRepoDescriptor(String url, Store store) {
    MavenRepositoryDescriptor repoDescriptor = store.find(MavenRepositoryDescriptor.class, url);
    if (repoDescriptor == null) {
        repoDescriptor = store.create(MavenRepositoryDescriptor.class);
        repoDescriptor.setUrl(url);
    }
    return repoDescriptor;
}
 
开发者ID:buschmais,项目名称:jqassistant-server,代码行数:9,代码来源:ScanArtifactJob.java

示例10: scan

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
@Override
public JavaSourceDescriptor scan(final FileResource item, final String path, final Scope scope, final Scanner scanner) throws IOException {
    final Store store = scanner.getContext().getStore();
    final JavaSourceFileDescriptor javaSourceFileDescriptor = store.create(JavaSourceFileDescriptor.class);
    javaSourceFileDescriptor.setFileName(path);
    importStream(store, item.createStream(), path);
    return javaSourceFileDescriptor;
}
 
开发者ID:kontext-e,项目名称:jqassistant-plugins,代码行数:9,代码来源:JavaparserScannerPlugin.java

示例11: scan

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
@Override
public GitRepositoryDescriptor scan(final FileResource item, final String path, final Scope scope, final Scanner scanner) throws IOException {
    counter++;

    // This is called with path = "/HEAD" since this is the only "accepted" file
    LOGGER.debug ("Scanning Git directory '{}' (call with path: '{}')", item.getFile(), path);
    Store store = scanner.getContext().getStore();
    final GitRepositoryDescriptor gitRepositoryDescriptor = store.create(GitRepositoryDescriptor.class);
    initGitDescriptor(gitRepositoryDescriptor, item.getFile());

    new GitRepositoryScanner(store, gitRepositoryDescriptor, range).scanGitRepo();

    return gitRepositoryDescriptor;
}
 
开发者ID:kontext-e,项目名称:jqassistant-plugins,代码行数:15,代码来源:GitScannerPlugin.java

示例12: scan

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
@Override
public CppClangAstDescriptor scan(final FileResource item, final String path, final Scope scope, final Scanner scanner) throws IOException {
    LOGGER.debug("Cpp scans path "+path);
    Store store = scanner.getContext().getStore();
    final CppClangAstDescriptor cppClangAstDescriptor = store.create(CppClangAstDescriptor.class);
    cppClangAstDescriptor.setFileName(path);
    new CppAstParser().readStream(store, item.createStream());
    return cppClangAstDescriptor;
}
 
开发者ID:kontext-e,项目名称:jqassistant-plugins,代码行数:10,代码来源:CppScannerPlugin.java

示例13: parseCxxRecordDecl

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
private void parseCxxRecordDecl(final Store store, final String normalizedLine) {
    if(normalizedLine.endsWith("definition") && normalizedLine.contains(" class ")) {
        ClassDescriptor classDescriptor = store.create(ClassDescriptor.class);
        int indexOfClass = normalizedLine.indexOf(" class ");
        int indexOfDefinition = normalizedLine.indexOf("definition", indexOfClass);
        classDescriptor.setName(normalizedLine.substring(indexOfClass + "class ".length(), indexOfDefinition).trim());
    }
}
 
开发者ID:kontext-e,项目名称:jqassistant-plugins,代码行数:9,代码来源:CppAstParser.java

示例14: readFiles

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
private void readFiles(final Store store, final CheckstyleType checkstyleType, final CheckstyleReportDescriptor checkstyleReportDescriptor) {
    for (FileType fileType : checkstyleType.getFile()) {
        final CheckstyleFileDescriptor checkstyleFileDescriptor = store.create(CheckstyleFileDescriptor.class);
        checkstyleFileDescriptor.setName(truncateName(fileType.getName()));
        checkstyleFileDescriptor.setFullQualifiedName(convertToFullQualifiedName(fileType.getName()));
        checkstyleReportDescriptor.getFiles().add(checkstyleFileDescriptor);
        readErrors(store, fileType, checkstyleFileDescriptor);
    }
}
 
开发者ID:kontext-e,项目名称:jqassistant-plugins,代码行数:10,代码来源:CheckstyleScannerPlugin.java

示例15: readErrors

import com.buschmais.jqassistant.core.store.api.Store; //导入方法依赖的package包/类
private void readErrors(final Store store, final FileType fileType, final CheckstyleFileDescriptor checkstyleFileDescriptor) {
    for (ErrorType errorType : fileType.getError()) {
        final CheckstyleErrorDescriptor checkstyleErrorDescriptor = store.create(CheckstyleErrorDescriptor.class);
        checkstyleErrorDescriptor.setLine(errorType.getLine());
        checkstyleErrorDescriptor.setColumn(errorType.getColumn());
        checkstyleErrorDescriptor.setSeverity(errorType.getSeverity());
        checkstyleErrorDescriptor.setMessage(errorType.getMessage());
        checkstyleErrorDescriptor.setSource(errorType.getSource());
        checkstyleFileDescriptor.getErrors().add(checkstyleErrorDescriptor);
    }
}
 
开发者ID:kontext-e,项目名称:jqassistant-plugins,代码行数:12,代码来源:CheckstyleScannerPlugin.java


注:本文中的com.buschmais.jqassistant.core.store.api.Store.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。