diff --git a/src/de/inetsoftware/jwebassembly/JWebAssembly.java b/src/de/inetsoftware/jwebassembly/JWebAssembly.java index 80b175d..22dac84 100644 --- a/src/de/inetsoftware/jwebassembly/JWebAssembly.java +++ b/src/de/inetsoftware/jwebassembly/JWebAssembly.java @@ -24,6 +24,7 @@ import java.io.OutputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import javax.annotation.Nonnull; @@ -41,7 +42,9 @@ import de.inetsoftware.jwebassembly.text.TextModuleWriter; */ public class JWebAssembly { - private List classFiles = new ArrayList<>(); + private final List classFiles = new ArrayList<>(); + + private final HashMap properties = new HashMap<>(); /** * Create a instance. @@ -73,6 +76,29 @@ public class JWebAssembly { classFiles.add( classFile ); } + /** + * Set property to control the behavior of the compiler + * + * @param key + * the key + * @param value + * the new value + */ + public void setProperty( String key, String value ) { + properties.put( key, value ); + } + + /** + * Get the value of a property. + * + * @param key + * the key + * @return the current value + */ + public String getProperty( String key ) { + return properties.get( key ); + } + /** * Convert the added files to a WebAssembly module in text representation. *