Examples of SourceFactory


Examples of com.pogofish.jadt.source.SourceFactory

    /**
     * Create a dummy configged jADT based on the provided syntaxErrors, semanticErrors, testSrcInfo, and sink factory
     * Useful for testing
     */
    public static JADT createDummyJADT(List<SyntaxError> syntaxErrors, List<SemanticError> semanticErrors, String testSrcInfo, SinkFactoryFactory factory) {
        final SourceFactory sourceFactory = new StringSourceFactory(TEST_STRING);
        final Doc doc = new Doc(TEST_SRC_INFO, Pkg._Pkg(NO_COMMENTS, "pkg"), Util.<Imprt> list(), Util.<DataType> list());
        final ParseResult parseResult = new ParseResult(doc, syntaxErrors);
        final DocEmitter docEmitter = new DummyDocEmitter(doc,  TEST_CLASS_NAME);
        final Parser parser = new DummyParser(parseResult, testSrcInfo, TEST_STRING);
        final Checker checker = new DummyChecker(semanticErrors);
View Full Code Here

Examples of org.apache.excalibur.source.SourceFactory

        final ServiceManager m = this.getComponentLocator();

        Source source = null;
        // search for a SourceFactory implementing the protocol
        SourceFactory factory = null;
        try {
            factory = this.getSourceFactory(m, protocol);
            systemID = this.absolutize(factory, baseURI, systemID);
            if (getLogger().isDebugEnabled()) {
                getLogger().debug("Resolved to systemID : " + systemID);
            }
            source = factory.getSource(systemID, parameters);
        } catch (final ProcessingException ce) {
            // no selector available, use fallback
        } finally {
            m.release(factory);
        }

        if (null == source) {
            try {
                factory = this.getSourceFactory(m, "*");
                systemID = this.absolutize(factory, baseURI, systemID);
                if (getLogger().isDebugEnabled()) {
                    getLogger().debug("Resolved to systemID : " + systemID);
                }
                source = factory.getSource(systemID, parameters);
            } catch (ProcessingException se) {
                throw new SourceException("Unable to select source factory for " + systemID, se);
            } finally {
                m.release(factory);
            }
View Full Code Here

Examples of org.apache.excalibur.source.SourceFactory

        } else {
            final ServiceManager m = this.getComponentLocator();

            // search for a SourceFactory implementing the protocol
            final String scheme = source.getScheme();
            SourceFactory factory = null;

            try {
                factory = this.getSourceFactory(m, scheme);
                factory.release(source);
            } catch (ProcessingException se) {
                try {
                    factory = this.getSourceFactory(m, "*");
                    factory.release(source);
                } catch (ProcessingException sse) {
                    throw new SourceFactoryNotFoundException("Unable to select source factory for " + source.getURI(), se);
                }
            } finally {
                m.release(factory);
View Full Code Here

Examples of org.apache.excalibur.source.SourceFactory

                protocol = "*";
        }

        Source source = null;
        // search for a SourceFactory implementing the protocol
        SourceFactory factory = null;
        try
        {
            factory = this.getSourceFactory( protocol );
            if ( factory != null )
            {
                systemID = absolutize( factory, baseURI, systemID );
                if( this.isDebugEnabled() )
                    this.debug( "Resolved to systemID : " + systemID );
                source = factory.getSource( systemID, parameters );
            }
        }
        finally
        {
            this.releaseSourceFactory( factory );
        }

        if( null == source )
        {
            try
            {
                factory = this.getSourceFactory("*");
                if ( factory == null )
                {
                    throw new SourceException( "Unable to select source factory for '" + systemID + "'. No default factory found.");
                }
                systemID = absolutize( factory, baseURI, systemID );
                if( this.isDebugEnabled() )
                    this.debug( "Resolved to systemID : " + systemID );
                source = factory.getSource( systemID, parameters );
            }
            finally
            {
                this.releaseSourceFactory(factory);
            }
View Full Code Here

Examples of org.apache.excalibur.source.SourceFactory

    {
        if( source == null ) return;

        // search for a SourceFactory implementing the protocol
        final String scheme = source.getScheme();
        SourceFactory factory = null;

        try
        {
            factory = this.getSourceFactory(scheme);
            if ( factory == null )
            {
                factory = this.getSourceFactory("*");
                if ( factory == null )
                {
                    throw new RuntimeException( "Unable to select source factory for '" + source.getURI() + "'.");
                }
            }
            factory.release(source);
        }
        finally
        {
            this.releaseSourceFactory( factory );
        }
View Full Code Here

Examples of org.apache.flume.SourceFactory

  private JsonFileConfigurationProvider provider;

  @Before
  public void setUp() {
    ChannelFactory channelFactory = new DefaultChannelFactory();
    SourceFactory sourceFactory = new DefaultSourceFactory();
    SinkFactory sinkFactory = new DefaultSinkFactory();

    channelFactory.register("memory", MemoryChannel.class);

    sourceFactory.register("seq", SequenceGeneratorSource.class);
    sourceFactory.register("netcat", NetcatSource.class);

    sinkFactory.register("null", NullSink.class);
    sinkFactory.register("logger", LoggerSink.class);

    provider = new JsonFileConfigurationProvider();
View Full Code Here

Examples of org.auraframework.impl.source.SourceFactory

            // Ooh, now _this_ is ugly. Because privileged namespaces are tracked by the
            // SourceFactory constructor, we'd best build a source factory for every loader.
            // This ensures that we do in the case of static registries. Note that it also
            // allows us to see source on static registries.
            //
            SourceFactory sf = new SourceFactory(markupLoaders);
            for (DefRegistry<?> reg : staticRegs) {
                if (reg instanceof StaticDefRegistryImpl) {
                    ((StaticDefRegistryImpl<?>)reg).setSourceFactory(sf);
                }
            }
View Full Code Here

Examples of org.auraframework.impl.source.SourceFactory

                markupLoaders.addAll(extraLoaders);
                javaLoaders.addAll(extraLoaders);
            }

            if (markupLoaders.size() > 0) {
                SourceFactory markupSourceFactory = new SourceFactory(markupLoaders);

                regBuild.add(createDefRegistry(new RootDefFactory(markupSourceFactory), rootDefTypes, rootPrefixes));
                regBuild.add(AuraRegistryProviderImpl.<ControllerDef> createJavascriptRegistry(markupSourceFactory,
                        DefType.CONTROLLER));
                regBuild.add(AuraRegistryProviderImpl.<TestSuiteDef> createJavascriptRegistry(markupSourceFactory,
View Full Code Here

Examples of org.auraframework.impl.source.SourceFactory

        addSourceAutoCleanup(ApplicationDef.class, baseContents, String.format("%s:houseparty", namespace));
        addSourceAutoCleanup(ApplicationDef.class, baseContents, String.format("%s:pantsparty", namespace));

        StringSourceLoader loader = StringSourceLoader.getInstance();
        List<SourceLoader> loaders = Lists.newArrayList((SourceLoader) loader);
        RootDefFactory factory = new RootDefFactory(new SourceFactory(loaders));

        assertTrue("RootDefFactory should have a find() method", factory.hasFind());
        assertTrue("find() not finding all sources",
                factory.find(new DescriptorFilter(String.format("markup://%s:*", namespace))).size() == 3);
        assertEquals("find() fails with wildcard as prefix", 1,
View Full Code Here

Examples of org.exolab.castor.builder.factory.SourceFactory

        // Now that we're ready to generate source and we know our configuration
        // has been fully parsed, create our SourceFactory.  (See CASTOR-1346.)
        // We will reuse this SourceFactory if we are invoked multiple times.
        if (_sourceFactory == null) {
            _sourceFactory = new SourceFactory(this, _infoFactory, _groupNaming, this);
            _sourceFactory.setCreateMarshalMethods(_createMarshalMethods);
            _sourceFactory.setTestable(_testable);
            _sourceFactory.setSAX1(_sax1);
            _sourceFactory.setCaseInsensitive(_caseInsensitive);
        }
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.