com.exactpro.sf.aml.AML3LanguageFactory Maven / Gradle / Ivy
/******************************************************************************
* Copyright 2009-2018 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
package com.exactpro.sf.aml;
import java.net.URL;
import java.net.URLClassLoader;
import com.exactpro.sf.aml.checkers.AML3Checker;
import com.exactpro.sf.aml.generator.CodeGenerator_new;
import com.exactpro.sf.configuration.suri.SailfishURI;
import com.exactpro.sf.scriptrunner.languagemanager.ICompatibilityChecker;
import com.exactpro.sf.scriptrunner.languagemanager.ILanguageFactory;
@Description("Automation Matrix Language version 3")
public class AML3LanguageFactory implements ILanguageFactory {
public static final SailfishURI URI = SailfishURI.unsafeParse("AML_v3");
private final ICompatibilityChecker checker = new AML3Checker();
@Override
public void init(ClassLoader... pluginClassLoaders) {
}
@Override
public String getName() {
return URI.getResourceName();
}
@Override
public Object getReader() {
return null;
}
@Override
public ICodeGenerator getGenerator() {
return new CodeGenerator_new();
}
@Override
public ICompatibilityChecker getChecker() {
return checker;
}
@Override
public ClassLoader createClassLoader(URL binFolder, ClassLoader parent) {
return new URLClassLoader(new URL[] { binFolder }, getClass().getClassLoader());
}
}