de.jflex.plugin.maven.ClassInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jflex-maven-plugin Show documentation
Show all versions of jflex-maven-plugin Show documentation
This is a Maven 3 plugin to generate Lexer code in Java from
a Lexer specification, using JFlex.
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* JFlex Maven3 plugin *
* Copyright (c) 2007-2017 Régis Décamps *
* All rights reserved. *
* *
* License: BSD *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package de.jflex.plugin.maven;
import java.io.File;
class ClassInfo {
String className = null;
String packageName = null;
/**
* Returns the (relative) path name of the java source code file that corresponds to the class.
*
* For instance, "org.foo.Bar" returns "org/foo/Bar.java"
*
* @return Name of the java file.
*/
String getOutputFilename() {
String packageDir = "";
if (packageName != null) {
packageDir += packageName.replace('.', File.separatorChar);
}
if (packageDir.length() > 0) {
packageDir += File.separatorChar;
}
return packageDir + className + ".java";
}
}