Tabnine Logo
ExmlConfiguration
Code IndexAdd Tabnine to your IDE (free)

How to use
ExmlConfiguration
in
net.jangaroo.exml.config

Best Java code snippets using net.jangaroo.exml.config.ExmlConfiguration (Showing top 20 results out of 315)

origin: CoreMedia/jangaroo-tools

protected ExmlConfiguration createExmlConfiguration(List<File> classPath, List<File> sourcePath, File outputDirectory) throws MojoExecutionException {
 if (configClassPackage == null) {
  throw new MojoExecutionException("parameter 'configClassPackage' is missing");
 }
 ExmlConfiguration exmlConfiguration = new ExmlConfiguration();
 exmlConfiguration.setConfigClassPackage(configClassPackage);
 exmlConfiguration.setClassPath(classPath);
 exmlConfiguration.setOutputDirectory(outputDirectory);
 try {
  exmlConfiguration.setSourcePath(sourcePath);
 } catch (IOException e) {
  throw new MojoExecutionException("could not determine source directory", e);
 }
 return exmlConfiguration;
}
origin: CoreMedia/jangaroo-tools

@SuppressWarnings({"UnusedDeclaration" })
public File computeGeneratedConfigClassFile(File exmlFile) {
 return computeConfigClassTarget(CompilerUtils.uncapitalize(CompilerUtils.removeExtension(exmlFile.getName())));
}
origin: CoreMedia/jangaroo-tools

public File computeConfigClassTarget(String configClassName) {
 return CompilerUtils.fileFromQName(getConfigClassPackage(), configClassName, getOutputDirectory(), Jooc.AS_SUFFIX);
}
origin: net.jangaroo/exml-compiler

public ExmlConfiguration parseConfig(CmdLineParser parser, ExmlConfiguration config) {
 if (config.getOutputDirectory() == null) {
  System.out.println(extendedUsage(parser, null)); // NOSONAR this is a cmd line tool
  return null;
 }
 if (!config.getOutputDirectory().exists()) {
  throw new IllegalArgumentException("destination directory does not exist: " + config.getOutputDirectory().getAbsolutePath());
 }
 if (config.getResourceOutputDirectory() == null) {
  config.setResourceOutputDirectory(config.getOutputDirectory());
 }
 return config;
}
origin: net.jangaroo/exml-compiler

private void scanAsFiles(Map<String, File> sourceFilesByName) {
 InputSource configPackageInputSource = sourcePathInputSource.getChild(config.getConfigClassPackage().replace('.', File.separatorChar));
 if (configPackageInputSource != null) {
  for (InputSource source : configPackageInputSource.list()) {
   File file = ((FileInputSource) source).getFile();
   if (file.isFile() && file.getName().endsWith(Jooc.AS_SUFFIX)) {
    try {
     File sourceDir = getConfig().findSourceDir(file);
     String qName = CompilerUtils.qNameFromFile(sourceDir, file);
     ConfigClass actionScriptConfigClass = findActionScriptConfigClass(qName);
     if (actionScriptConfigClass != null) {
      addSourceConfigClass(sourceFilesByName, file, actionScriptConfigClass);
     }
    } catch (IOException e) {
     throw new ExmlcException("could not read AS file", e);
    }
   }
  }
 }
}
origin: net.jangaroo/exml-compiler

public void generateXsd(Writer output) throws IOException, TemplateException {
 exmlConfigPackageXsdGenerator.generateXsdFile(getSourceConfigClasses(), config.getConfigClassPackage(), output);
 if (getConfig().getValidationMode() != ValidationMode.OFF) {
  try {
   new ExmlValidator(getConfig()).validateAllExmlFiles();
  } catch (Exception e) {
   throw new ExmlcException("unable to start validation", e);
  }
 }
}
origin: CoreMedia/jangaroo-tools

public ConfigClassRegistry(final ExmlConfiguration config) throws IOException {
 this.config = config;
 sourcePathInputSource = PathInputSource.fromFiles(config.getSourcePath(), new String[0], true);
 ParserOptions parserOptions = new CCRParserOptions();
 jangarooParser = new JangarooParser(parserOptions, new StdOutCompileLog()) {
  @Override
  protected InputSource findSource(String qname) {
   InputSource inputSource = super.findSource(qname);
   if (inputSource != null) {
    // A regular source file (not a generated file) has been found. Use it.
    return inputSource;
   }
   // Just in case the requested class is a class
   // that is generated from an EXML file, regenerate the file before
   // it is too late. This will only affect generated files, so it is pretty safe.
   tryGenerateClass(qname);
   // Just in case the source was not found on the first attempt, fetch it again.
   return super.findSource(qname);
  }
 };
 List<File> fullClassPath = new ArrayList<File>(config.getClassPath());
 fullClassPath.add(config.getOutputDirectory());
 InputSource classPathInputSource = PathInputSource.fromFiles(fullClassPath,
  new String[]{"", JangarooParser.JOO_API_IN_JAR_DIRECTORY_PREFIX}, false);
 jangarooParser.setUp(sourcePathInputSource, classPathInputSource);
 exmlConfigPackageXsdGenerator = new ExmlConfigPackageXsdGenerator();
}
origin: net.jangaroo/exml-compiler

@Override
public void generateAllComponentClasses() {
 for (File sourceFile : getConfig().getSourceFiles()) {
  if (sourceFile.getName().endsWith(EXML_SUFFIX)) {
   generateComponentClass(sourceFile);
  }
 }
}
origin: CoreMedia/jangaroo-tools

@SuppressWarnings({"UnusedDeclaration" })
public File computeGeneratedComponentClassFile(File exmlFile) throws IOException {
 File sourceDir = findSourceDir(exmlFile);
 String qName = CompilerUtils.qNameFromFile(sourceDir, exmlFile);
 String className = ExmlUtils.createComponentClassName(CompilerUtils.className(qName));
 String packageName = CompilerUtils.packageName(qName);
 // compute potential file location of component class in source directory:
 File classFile = CompilerUtils.fileFromQName(packageName, className, sourceDir, Jooc.AS_SUFFIX);
 // component class is only generated if it is not already present as source:
 return classFile.exists()
     ? null
     : CompilerUtils.fileFromQName(packageName, className, getOutputDirectory(), Jooc.AS_SUFFIX);
}
origin: CoreMedia/jangaroo-tools

 @Override
 protected void executeExmlc(Exmlc exmlc) {
  if (exmlc.getConfig().getValidationMode() != ValidationMode.OFF) {
   getLog().info("validating " + exmlc.getConfig().getSourceFiles().size() + " EXML files...");
  }

  //generate the XSD for that
  File xsdFile = exmlc.generateXsd();
  projectHelper.attachArtifact(getProject(), "xsd", xsdFile);
  getLog().info("xsd-file '" + xsdFile + "' generated.");

  // add target/generated-resources to project's resources so XSDs are always packaged:
  Resource generatedResources = new Resource();
  generatedResources.setDirectory(getGeneratedResourcesDirectory().getPath());
  getProject().addResource(generatedResources);
  getLog().info("added project resource '" + generatedResources + ".");
 }
}
origin: CoreMedia/jangaroo-tools

 public ExmlConfiguration parse(String[] args) throws CommandLineParseException {
  ExmlConfiguration config = new ExmlConfiguration();

  CmdLineParser parser = new CmdLineParser(config);
  try {
   // parse the arguments.
   parser.parseArgument(args);
  } catch (CmdLineException e) {
   StringBuilder msg = extendedUsage(parser, e);
   throw new CommandLineParseException(msg.toString(), -1);
  }
  return parseConfig(parser, config);
 }
}
origin: net.jangaroo/exml-compiler

@Override
public File generateXsd() {
 // Maybe even the directory does not exist.
 File targetPackageFolder = getConfig().getResourceOutputDirectory();
 if(!targetPackageFolder.exists()) {
  //noinspection ResultOfMethodCallIgnored
  targetPackageFolder.mkdirs(); // NOSONAR
 }
 File result = new File(targetPackageFolder, getConfig().getConfigClassPackage() + ".xsd");
 Writer writer = null;
 try {
  writer = new OutputStreamWriter(new FileOutputStream(result), net.jangaroo.exml.api.Exmlc.OUTPUT_CHARSET);
  configClassRegistry.generateXsd(writer);
 } catch (Exception e) {
  throw new ExmlcException("unable to generate xsd file: " + e.getMessage(), e);
 } finally {
  try {
   if (writer != null) {
    writer.close();
   }
  } catch (IOException e) {
   //never happen
  }
 }
 return result;
}
origin: net.jangaroo/exml-compiler

List<File> mxmlFiles = new ArrayList<File>();
Collection<ExmlSourceFile> exmlSourceFiles;
List<File> sourceFiles = configClassRegistry.getConfig().getSourceFiles();
if (sourceFiles.isEmpty()) {
 exmlSourceFiles = exmlSourceFilesByConfigClassName.values();
if (!configClassRegistry.getConfig().isKeepExmlFiles()) {
origin: CoreMedia/jangaroo-tools

private String computeConfigClassName(File exmlFile) {
 return CompilerUtils.qName(
     getConfig().getConfigClassPackage(),
     CompilerUtils.uncapitalize(CompilerUtils.removeExtension(exmlFile.getName())));
}
origin: net.jangaroo/exml-compiler

@Override
public void error(final SAXParseException e) throws SAXException {
 logSAXParseException(exmlFile, e, config.getValidationMode() == ValidationMode.ERROR);
}
origin: CoreMedia/jangaroo-tools

private void scanAsFiles(Map<String, File> sourceFilesByName) {
 InputSource configPackageInputSource = sourcePathInputSource.getChild(config.getConfigClassPackage().replace('.', File.separatorChar));
 if (configPackageInputSource != null) {
  for (InputSource source : configPackageInputSource.list()) {
   File file = ((FileInputSource) source).getFile();
   if (file.isFile() && file.getName().endsWith(Jooc.AS_SUFFIX)) {
    try {
     File sourceDir = getConfig().findSourceDir(file);
     String qName = CompilerUtils.qNameFromFile(sourceDir, file);
     ConfigClass actionScriptConfigClass = findActionScriptConfigClass(qName);
     if (actionScriptConfigClass != null) {
      addSourceConfigClass(sourceFilesByName, file, actionScriptConfigClass);
     }
    } catch (IOException e) {
     throw new ExmlcException("could not read AS file", e);
    }
   }
  }
 }
}
origin: CoreMedia/jangaroo-tools

public ExmlConfiguration parseConfig(CmdLineParser parser, ExmlConfiguration config) {
 if (config.getOutputDirectory() == null) {
  System.out.println(extendedUsage(parser, null)); // NOSONAR this is a cmd line tool
  return null;
 }
 if (!config.getOutputDirectory().exists()) {
  throw new IllegalArgumentException("destination directory does not exist: " + config.getOutputDirectory().getAbsolutePath());
 }
 if (config.getResourceOutputDirectory() == null) {
  config.setResourceOutputDirectory(config.getOutputDirectory());
 }
 return config;
}
origin: CoreMedia/jangaroo-tools

public void generateXsd(Writer output) throws IOException, TemplateException {
 exmlConfigPackageXsdGenerator.generateXsdFile(getSourceConfigClasses(), config.getConfigClassPackage(), output);
 if (getConfig().getValidationMode() != ValidationMode.OFF) {
  try {
   new ExmlValidator(getConfig()).validateAllExmlFiles();
  } catch (Exception e) {
   throw new ExmlcException("unable to start validation", e);
  }
 }
}
origin: net.jangaroo/exml-compiler

public ConfigClassRegistry(final ExmlConfiguration config) throws IOException {
 this.config = config;
 sourcePathInputSource = PathInputSource.fromFiles(config.getSourcePath(), new String[0], true);
 ParserOptions parserOptions = new CCRParserOptions();
 jangarooParser = new JangarooParser(parserOptions, new StdOutCompileLog()) {
  @Override
  protected InputSource findSource(String qname) {
   InputSource inputSource = super.findSource(qname);
   if (inputSource != null) {
    // A regular source file (not a generated file) has been found. Use it.
    return inputSource;
   }
   // Just in case the requested class is a class
   // that is generated from an EXML file, regenerate the file before
   // it is too late. This will only affect generated files, so it is pretty safe.
   tryGenerateClass(qname);
   // Just in case the source was not found on the first attempt, fetch it again.
   return super.findSource(qname);
  }
 };
 List<File> fullClassPath = new ArrayList<File>(config.getClassPath());
 fullClassPath.add(config.getOutputDirectory());
 InputSource classPathInputSource = PathInputSource.fromFiles(fullClassPath,
  new String[]{"", JangarooParser.JOO_API_IN_SWC_DIRECTORY_PREFIX}, false);
 jangarooParser.setUp(sourcePathInputSource, classPathInputSource);
 jangarooParser.setCompilableSuffixes(Collections.singletonList(Jooc.AS_SUFFIX));
 exmlConfigPackageXsdGenerator = new ExmlConfigPackageXsdGenerator();
}
origin: CoreMedia/jangaroo-tools

@Override
public void generateAllComponentClasses() {
 for (File sourceFile : getConfig().getSourceFiles()) {
  if (sourceFile.getName().endsWith(EXML_SUFFIX)) {
   generateComponentClass(sourceFile);
  }
 }
}
net.jangaroo.exml.configExmlConfiguration

Most used methods

  • <init>
  • computeConfigClassTarget
  • findSourceDir
  • getConfigClassPackage
  • getOutputDirectory
  • getSourceFiles
  • getValidationMode
  • setClassPath
  • setConfigClassPackage
  • setOutputDirectory
  • setResourceOutputDirectory
  • setSourcePath
  • setResourceOutputDirectory,
  • setSourcePath,
  • computeGeneratedComponentClassFile,
  • getClassPath,
  • getExtAsJar,
  • getLog,
  • getResourceOutputDirectory,
  • getSourcePath,
  • isConvertToMxml,
  • isKeepExmlFiles

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Join (org.hibernate.mapping)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now