Package org.auraframework.impl.source

Examples of org.auraframework.impl.source.StringSourceLoader$SingletonHolder


     * @return
     * @throws Exception
     */
    @AuraEnabled
    public static DefDescriptor<?> addSource(@Key("name") String name, @Key("content") String content, @Key("defType") String defType) throws Exception {
        StringSourceLoader stringSourceLoader = StringSourceLoader.getInstance();
        return stringSourceLoader.addSource(Enum.valueOf(DefType.class, defType).getPrimaryInterface(), content, name, true).getDescriptor();
    }
View Full Code Here


     * @param defType COMPONENT / APPLICATION / EVENT etc
     * @throws Exception
     */
    @AuraEnabled
    public static void removeSource(@Key("names") List<String> names, @Key("defType") List<String> defType) throws Exception {
        StringSourceLoader stringSourceLoader = StringSourceLoader.getInstance();
       
        for(int i =0; i< names.size();i++){
            DefDescriptor<?> descriptor = Aura.getDefinitionService().getDefDescriptor(names.get(i), Enum.valueOf(DefType.class, defType.get(i)).getPrimaryInterface());
            stringSourceLoader.removeSource(descriptor);
        }
        return;
    }
View Full Code Here

    private Set<DefDescriptor<?>> cleanUpDds;
   
    public void tearDown() {
        if (cleanUpDds != null) {
            StringSourceLoader loader = StringSourceLoader.getInstance();
            for (DefDescriptor<?> dd : cleanUpDds) {
                loader.removeSource(dd);
            }
            cleanUpDds.clear();
        }
    }
View Full Code Here

     * @param isPrivilegedNamespace if true, namespace is privileged
     * @return the {@link DefDescriptor} for the created definition
     */
    public <T extends Definition> DefDescriptor<T> addSourceAutoCleanup(Class<T> defClass, String contents,
            String namePrefix, boolean isPrivilegedNamespace) {
        StringSourceLoader loader = StringSourceLoader.getInstance();
        DefDescriptor<T> descriptor = loader.addSource(defClass, contents, namePrefix, isPrivilegedNamespace).getDescriptor();
        markForCleanup(descriptor);
        return descriptor;
    }
View Full Code Here

     * @param descriptor descriptor for the source to be created
     * @param contents source contents
     * @return the {@link DefDescriptor} for the created definition
     */
    public <T extends Definition> DefDescriptor<T> addSourceAutoCleanup(DefDescriptor<T> descriptor, String contents, boolean isPrivilegedNamespace) {
        StringSourceLoader loader = StringSourceLoader.getInstance();
        loader.putSource(descriptor, contents, false, isPrivilegedNamespace);
        markForCleanup(descriptor);
        return descriptor;
    }
View Full Code Here

        DefDescriptor<ApplicationDef> houseboat = addSourceAutoCleanup(ApplicationDef.class, baseContents,
                String.format("%s:houseboat", namespace));
        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",
View Full Code Here

TOP

Related Classes of org.auraframework.impl.source.StringSourceLoader$SingletonHolder

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.