Examples of ModuleSource


Examples of cn.com.byd.compose.source.ModuleSource

    if (attributeMethod == null) {
      throw new PareseException("Not found necessary attribute." + attributeMethod);
    }
    Attribute attributeId = element.attribute(ATTRIBUTE_ID);
    ModuleSource source = ModuleSource.INSTANCE;
    ModuleMethodSource methodConfig = new ModuleMethodSource();
    // 设定方法名
    methodConfig.setMethod(attributeMethod.getStringValue());
    methodConfig.setId(attributeId == null ? null : attributeId.getStringValue());
    MethodContext methodContext = new MethodContext();

    methodContext.setIsLog(attributeLog == null ? false : Boolean.parseBoolean(attributeLog.getStringValue()));

    methodContext.setIsTransaction(attributeTransaction == null ? false :
                     Boolean.parseBoolean(attributeTransaction.getStringValue()));

    methodContext.setIsVerify(attributeVerify == null ? false :
                  Boolean.parseBoolean(attributeVerify.getStringValue()));

    methodConfig.setMethodContext(methodContext);

    source.setClassAndMethodList(attributeBeanId.getStringValue(), methodConfig);

    // 解析xml内部组件
    Iterator<Element> it = element.elementIterator();
    Element subElement = null;
    while (it.hasNext()) {
View Full Code Here

Examples of org.eclipse.dltk.compiler.env.ModuleSource

     * if an ASTVisitor implementation is created for this, just override getFoldingVisitor() and
     * remove this method
     */
    ISourceParser pp = null;
    pp = DLTKLanguageManager.getSourceParser(RutaNature.NATURE_ID);
    ModuleDeclaration md = (ModuleDeclaration) pp.parse(new ModuleSource(code), null);
    List statements = md.getStatements();
    if (statements == null) {
      return new CodeBlock[0];
    }

View Full Code Here

Examples of org.eclipse.dltk.compiler.env.ModuleSource

    IModelElement el = this.editor.getInputModelElement();
    if (el != null && el instanceof ISourceModule) {
      md = SourceParserUtil.getModuleDeclaration((ISourceModule) el, null);
    }
    if (md == null) {
      md = (ModuleDeclaration) pp.parse(new ModuleSource(contents), null);
    }
    if (md == null) {
      return new PairBlock[0];
    }
    final List result = new ArrayList();
View Full Code Here

Examples of org.eclipse.dltk.compiler.env.ModuleSource

 
  @Test
  public void testBasic() throws Exception { testBasic$(); }
  public void testBasic$() throws Exception {
    String relativePath = "relative/path/foo.d";
    ModuleSource moduleSource = new ModuleSource(relativePath, "module blah;");
    Path filePath = DToolClient.getPathHandleForModuleSource(moduleSource);
   
    ClientModuleParseCache clientModuleCache = client.getClientModuleCache();
    assertEquals(clientModuleCache.getParsedModuleOrNull(filePath, moduleSource).module.getName(), "blah");
    assertEquals(clientModuleCache.getExistingParsedModuleNode(filePath).getName(), "blah");
   
    testCodeCompletion(moduleSource, 0,
      "blah");
    testCodeCompletion(new ModuleSource(relativePath, "module xpto;"), 0,
      "xpto");
    assertTrue(client.getServerSemanticManager().getParseCache().getEntry(MiscUtil.createPath(relativePath))
      .isWorkingCopy() == false);
   
    Path path = DToolTestResources.getTestResourcePath().resolve("dummy__non_existant.d");
    assertTrue(path.isAbsolute());
    testCodeCompletion(new ModuleSource(path.toString(), "module blah;"), 0,
        "blah");
   
    // Error case
    try {
      client.doCodeCompletion((Path) null, 0, null);
View Full Code Here

Examples of org.eclipse.dltk.compiler.env.ModuleSource

     * if an ASTVisitor implementation is created for this, just override getFoldingVisitor() and
     * remove this method
     */
    ISourceParser pp = null;
    pp = DLTKLanguageManager.getSourceParser(RutaNature.NATURE_ID);
    ModuleDeclaration md = (ModuleDeclaration) pp.parse(new ModuleSource(code), null);
    List statements = md.getStatements();
    if (statements == null) {
      return new CodeBlock[0];
    }

View Full Code Here

Examples of org.eclipse.dltk.compiler.env.ModuleSource

    IModelElement el = this.editor.getInputModelElement();
    if (el != null && el instanceof ISourceModule) {
      md = SourceParserUtil.getModuleDeclaration((ISourceModule) el, null);
    }
    if (md == null) {
      md = (ModuleDeclaration) pp.parse(new ModuleSource(contents), null);
    }
    if (md == null) {
      return new PairBlock[0];
    }
    final List result = new ArrayList();
View Full Code Here

Examples of org.eclipse.dltk.compiler.env.ModuleSource

    throws Exception
  {
    InputStream in = file.getContents();
    try {
      String path = file.getLocation().toOSString();
      return new ModuleSource(path, IOUtils.toString(in));
    }finally{
      IOUtils.closeQuietly(in);
    }
  }
View Full Code Here

Examples of org.gradle.internal.component.model.ModuleSource

    public ModuleDescriptorCacheEntry read(Decoder decoder) throws Exception {
        byte type = decoder.readByte();
        boolean isChanging = decoder.readBoolean();
        String packaging = decoder.readNullableString();
        long createTimestamp = decoder.readLong();
        ModuleSource moduleSource = moduleSourceSerializer.read(decoder);
        byte[] encodedHash = decoder.readBinary();
        BigInteger hash = new BigInteger(encodedHash);
        return new ModuleDescriptorCacheEntry(type, isChanging, packaging, createTimestamp, hash, moduleSource);
    }
View Full Code Here

Examples of org.gradle.internal.component.model.ModuleSource

        }
    }

    public void resolveArtifact(ComponentArtifactMetaData artifact, ModuleSource source, BuildableArtifactResolveResult result) {
        ModuleComponentRepository sourceRepository = findSourceRepository(source);
        ModuleSource unpackedSource = unpackSource(source);

        // First try to resolve the artifacts locally before going remote
        sourceRepository.getLocalAccess().resolveArtifact(artifact, unpackedSource, result);
        if (!result.hasResult()) {
            sourceRepository.getRemoteAccess().resolveArtifact(artifact, unpackedSource, result);
View Full Code Here

Examples of org.lilyproject.runtime.rapi.ModuleSource

        this.moduleDefinition = moduleDefinition;
        this.runtime = runtime;
    }

    private ModuleConfig build() {
        ModuleSource moduleSource = null;
        VersionManager versionManager = new VersionManager(runtime);
        try {
            moduleSource = runtime.getModuleSourceManager().getModuleSource(moduleDefinition.getFile(), moduleDefinition.getSourceType());

            // build classpath
            ClassLoadingConfig classLoadingConfig;
            InputStream is = moduleSource.getClassLoaderConfig();
            if (is != null) {
                try {
                    Document document = DocumentHelper.parse(is);
                    classLoadingConfig = XmlClassLoaderBuilder.build(document.getDocumentElement(), moduleSource, runtime.getArtifactRepository(), versionManager);
                } finally {
                    IOUtils.closeQuietly(is);
                }
            } else {
                ClasspathEntry selfEntry = new ClasspathEntry(new FileArtifactRef(moduleSource.getClassPathEntry()), ArtifactSharingMode.PROHIBITED, moduleSource);
                classLoadingConfig = new ClassLoadingConfigImpl(Collections.singletonList(selfEntry), runtime.getArtifactRepository());
            }

            return new ModuleConfigImpl(moduleDefinition, classLoadingConfig, moduleSource);

        } catch (Throwable e) {
            if (moduleSource != null) {
                try {
                    moduleSource.dispose();
                } catch (Throwable e2) {
                    log.error("Error disposing module source for file " + moduleDefinition.getFile().getAbsolutePath(), e2);
                }
            }
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.