Examples of Source


Examples of com.asakusafw.runtime.stage.input.StageInputSplit.Source

        if (current != null) {
            baseProgress += progressPerSource;
            current.close();
        }
        if (sources.hasNext()) {
            Source next = sources.next();
            InputFormat<?, ?> format = ReflectionUtils.newInstance(next.getFormatClass(), context.getConfiguration());
            current = format.createRecordReader(next.getSplit(), context);
            current.initialize(next.getSplit(), context);
        } else {
            eof = true;
            current = VOID;
        }
    }
View Full Code Here

Examples of com.coherentlogic.wb.client.core.domain.Source

        result.setId(DataPointCountryDAOTest.ID);

        result.setIndicatorTopics(createIndicatorTopics());
        result.setName(NAME);

        Source source = IdValuePairTestHelper.create(Source.class);

        result.setSource(source);
        result.setSourceNote(SOURCE_NOTE);
        result.setSourceOrganization(SOURCE_ORGANISATION);
View Full Code Here

Examples of com.colorfulsoftware.atom.Source

      assertNotNull(feed.getEntries());

      for (Entry entry : feed.getEntries()) {
        assertNotNull(entry.getSource());
        Source source = entry.getSource();
        assertNotNull(source.getId());
      }

      BufferedWriter out = new BufferedWriter(new FileWriter(
          "target/source1.xml"));
      out.write(feed.toString());
View Full Code Here

Examples of com.colorfulsoftware.rss.Source

   * tests building a source element.
   */
  @Test
  public void testBuildSource() {
    try {
      Source source = rssDoc.buildSource(null, "somewhere cool");
      assertNotNull(source);
      fail("we should have thrown an exception above.");
    } catch (RSSpectException r) {
      assertEquals(r.getMessage(),
          "source elements MUST contain a url attribute.");
    }

    try {
      Source source = rssDoc.buildSource(rssDoc.buildAttribute("cat",
          "dog"), "somewhere cool");
      assertNotNull(source);
      fail("we should have thrown an exception above.");
    } catch (RSSpectException r) {
      assertEquals(r.getMessage(),
          "source elements MUST contain a url attribute.");
    }

    try {
      Source source = rssDoc.buildSource(rssDoc.buildAttribute("url",
          "http://www.earthbeats.net"), "somewhere cool");
      assertNotNull(source);
      assertNotNull(source.getUrl());
      assertNotNull(source.getUrl().getName());
      assertEquals(source.getUrl().getName(), "url");
      assertNotNull(source.getUrl().getValue());
      assertEquals(source.getUrl().getValue(),
          "http://www.earthbeats.net");
      assertNotNull(source.getSource());
      assertEquals(source.getSource(), "somewhere cool");
    } catch (Exception e) {
      fail("should not fail here.");
    }

    try {
      rssDoc.buildSource(rssDoc.buildAttribute("url",
          "http://www.colorfulsoftware.com"), null);
      fail("should not get here.");
    } catch (RSSpectException r) {
      assertEquals(r.getMessage(), "source SHOULD NOT be blank.");
    }

    try {
      rssDoc.buildSource(rssDoc.buildAttribute("url",
          "http://www.colorfulsoftware.com"), "");
      fail("should not get here.");
    } catch (RSSpectException r) {
      assertEquals(r.getMessage(), "source SHOULD NOT be blank.");
    }

    try {
      Source source = rssDoc.buildSource(rssDoc.buildAttribute("url",
          "http://www.colorfulsoftware.com"), "Colorful Software");
      assertNotNull(source);
      assertEquals(source.getSource(), "Colorful Software");
    } catch (RSSpectException r) {
      fail("should not get here.");
    }
  }
View Full Code Here

Examples of com.dotcms.repackage.javax.xml.transform.Source

      if(!canUserEvalute()){
        Logger.error(XsltTool.class, "XSLTTool user does not have scripting access ");
        return null;
      }
      String outputXML = null;
      Source xmlSource = null;
      XSLTranformationDoc doc = null;
      Host host = hostWebAPI.getCurrentHost(request);

      /*Validate if in cache exists a valid version*/
      doc = XSLTransformationCache.getXSLTranformationDocByXMLPath(XMLPath,XSLPath);

      if(doc == null){
        /*Get the XSL source*/
        java.io.File binFile = null;
        Identifier xslId = APILocator.getIdentifierAPI().find(host, XSLPath);
        if(xslId!=null && InodeUtils.isSet(xslId.getId()) && xslId.getAssetType().equals("contentlet")){
          Contentlet cont = APILocator.getContentletAPI().findContentletByIdentifier(xslId.getId(), true, APILocator.getLanguageAPI().getDefaultLanguage().getId(), userAPI.getSystemUser(),false);
          if(cont!=null && InodeUtils.isSet(cont.getInode())){
            binFile = cont.getBinary(FileAssetAPI.BINARY_FIELD);
          }
        }else{
          File xslFile = fileAPI.getFileByURI(XSLPath, host, true, userAPI.getSystemUser(),false);
          binFile = fileAPI.getAssetIOFile (xslFile);
        }
       
       
        /*Get the XML Source from file or from URL*/
        if(!XMLPath.startsWith("http")){
          Identifier xmlId = APILocator.getIdentifierAPI().find(host, XMLPath);
          if(xmlId!=null && InodeUtils.isSet(xmlId.getId()) && xmlId.getAssetType().equals("contentlet")){
            Contentlet cont = APILocator.getContentletAPI().findContentletByIdentifier(xmlId.getId(), true, APILocator.getLanguageAPI().getDefaultLanguage().getId(), userAPI.getSystemUser(),false);
            if(cont!=null && InodeUtils.isSet(cont.getInode())){
              xmlSource = new StreamSource(new InputStreamReader(new FileInputStream(cont.getBinary(FileAssetAPI.BINARY_FIELD)), "UTF8"));
            }
          }else{
            File xmlFile = fileAPI.getFileByURI(XMLPath, host, true,userAPI.getSystemUser(),false);
            xmlSource = new StreamSource(new InputStreamReader(new FileInputStream(fileAPI.getAssetIOFile(xmlFile)), "UTF8"));
          }

        }else{
          xmlSource = new StreamSource(XMLPath);
        }

        Source xsltSource = new StreamSource(new InputStreamReader(new FileInputStream(binFile), "UTF8"));

        // create an instance of TransformerFactory
        TransformerFactory transFact = TransformerFactory.newInstance();
        StreamResult result = new StreamResult(new ByteArrayOutputStream());
        Transformer trans = transFact.newTransformer(xsltSource);
View Full Code Here

Examples of com.google.dart.engine.source.Source

     *
     * @param library the library to be processed to find libraries that have not yet been traversed
     * @throws AnalysisException if some portion of the library graph could not be traversed
     */
    private void computeLibraryDependencies(ResolvableLibrary library) {
      Source librarySource = library.getLibrarySource();
      DartEntry dartEntry = getReadableDartEntry(librarySource);
      Source[] importedSources = getSources(librarySource, dartEntry, DartEntry.IMPORTED_LIBRARIES);
      if (taskData != null) {
        return;
      }
View Full Code Here

Examples of com.google.gdata.model.atom.Source

        if ((!isIcon && !isLogo) || !(parent instanceof Source)) {
          return super.startElement(xw, parent, e, metadata);
        }

        Source source = (Source) parent;

        if (isIcon && source.hasElement(Source.LOGO)) {
          // atom:logo takes precedence
          return false;
        }

        xw.startElement(Namespaces.rssNs, "image", null, null);
        xw.simpleElement(Namespaces.rssNs, "url", null,
            String.valueOf(e.getTextValue()));

        TextContent title = source.getTitle();
        if (title != null) {
          xw.simpleElement(Namespaces.rssNs, "title", null,
              title.getPlainText());
        }
        Link htmlLink = source.getHtmlLink();
        if (htmlLink != null) {
          xw.simpleElement(Namespaces.rssNs, "link", null, htmlLink.getHref());
        }
        xw.endElement(Namespaces.rssNs, "image");
View Full Code Here

Examples of com.google.gwt.resources.client.ClientBundle.Source

   */
  private void generateTemplateResourceInterface(InjectableInstance<Templated> ctx, final MetaClass type) {
    ClassStructureBuilder<?> componentTemplateResource = ClassBuilder.define(getTemplateTypeName(type)).publicScope()
        .interfaceDefinition().implementsInterface(Template.class).implementsInterface(ClientBundle.class)
        .body()
        .publicMethod(TextResource.class, "getContents").annotatedWith(new Source() {

          @Override
          public Class<? extends Annotation> annotationType() {
            return Source.class;
          }
View Full Code Here

Examples of com.google.test.metric.report.Source

  public void testExample() throws Exception {
    IssuesReporter reporter = new IssuesReporter(new LinkedList<ClassIssues>(), costModel);
    ReportModel model = new AboutTestabilityReport(reporter, new SourceLoader(null) {
      @Override
      public Source load(String name) {
        return new Source(asList(
            new Line(1, "Copyright garbage!"),
            new Line(2, "package com.google.test.metric.example;"),
            new Line(3, "import java.util.List;"),
            new Line(4, "  "),
            new Line(5, "class SumOfPrimes {"),
View Full Code Here

Examples of com.hp.hpl.jena.gvs.Source

   */
  private void initControl() {
    Model authenticationModel = createAuthenticationModel();
   
    Store store = new MemoryStoreImpl();
    Source authenticationSource = new SourceImpl("http://localhost/authentication-master#");
    store.assertGraph(authenticationSource, new FCAGraphImpl(authenticationModel));
   
    Model authorizationModel = createAuthorizationModel();
    Source authorizationSource = new SourceImpl("http://localhost/authorization-master#");
    store.assertGraph(authorizationSource, new FCAGraphImpl(authorizationModel));
   
    Set<Source> sources = new HashSet<Source>();
    sources.add(authenticationSource);
    sources.add(authorizationSource);
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.