public Model translate( Reader reader, String inputType, Properties parameters ) throws ModelloException { throw new ModelloRuntimeException( "Not implemented." ); }
protected Properties getModelloParameters( String version ) { Properties parameters = getModelloParameters( version, true ); return parameters; }
protected void compileGeneratedSources( boolean useJava5 ) throws IOException, CompilerException { compileGeneratedSources( getName(), useJava5 ); }
public void generate( Model model, Properties parameters ) throws ModelloException { initialize( model, parameters ); try { generateXsd( parameters ); } catch ( IOException ex ) { throw new ModelloException( "Exception while generating xsd.", ex ); } }
public void generate( Model model, Properties parameters ) throws ModelloException { initialize( model, parameters ); requiresDomSupport = false; try { generateDom4jWriter(); } catch ( IOException ex ) { throw new ModelloException( "Exception while generating Dom4j Writer.", ex ); } }
public void generate( Model model, Properties parameters ) throws ModelloException { initialize( model, parameters ); requiresDomSupport = false; try { generateXpp3Writer(); } catch ( IOException ex ) { throw new ModelloException( "Exception while generating XPP3 Writer.", ex ); } }
public MetadataPlugin getMetadataPlugin( String metadataId ) { MetadataPlugin metadata = getPlugin( metadataId ); if ( metadata == null ) { throw new ModelloRuntimeException( "No such metadata plugin: '" + metadataId + "'." ); } return metadata; }
public ModelloGenerator getGeneratorPlugin( String generatorId ) { ModelloGenerator generator = getPlugin( generatorId ); if ( generator == null ) { throw new ModelloRuntimeException( "No such generator plugin: '" + generatorId + "'." ); } return generator; }
public static void main( String[] args ) throws Exception { Modello modello = new Modello(); parseArgumentsFromCommandLine( args ); modello.generate( ReaderFactory.newXmlReader( modelFile ), outputType, parameters ); }
protected void setUp() throws Exception { super.setUp(); FileUtils.deleteDirectory( getOutputClasses() ); assertTrue( getOutputClasses().mkdirs() ); }
protected File getOutputDirectory() { return getTestFile( "target/generator-results/" + getName() ); }
protected void addDependency( String groupId, String artifactId ) { File dependencyFile = getDependencyFile( groupId, artifactId ); dependencies.add( dependencyFile ); addClassPathFile( dependencyFile ); }
protected void compileGeneratedSources( String verifierId ) throws IOException, CompilerException { compileGeneratedSources( verifierId, true ); }
protected File getOutputDirectory() { return new File( super.getOutputDirectory(), "sources" ); }
public void saveModel( Model model, Writer writer ) throws ModelloException { throw new ModelloRuntimeException( "Not implemented." ); }
protected void compileGeneratedSources() throws IOException, CompilerException { compileGeneratedSources( getName() ); }
/** * Decreases the indent level by 1 **/ public void unindent() { if ( currentIndent == 0 ) { throw new ModelloRuntimeException( "Cannot unindent: current indent is 0." ); } currentIndent -= indentSize; } //-- unindent
public ModelField getField( String type, VersionRange versionRange ) { throw new ModelloRuntimeException( "There are no field '" + type + "' in an interface." ); }
protected String getParameter( Properties parameters, String name ) { String value = parameters.getProperty( name ); if ( value == null ) { throw new ModelloRuntimeException( "Missing parameter '" + name + "'." ); } return value; }
public T getPlugin( String name ) { T plugin = plugins.get( name ); if ( plugin == null ) { throw new ModelloRuntimeException( "No such plugin: " + name ); } return plugin; }