Add get/setProperty

This commit is contained in:
Volker Berlin 2018-10-07 18:57:41 +02:00
parent bd6b2ef3c6
commit 53494d55be

View File

@ -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<URL> classFiles = new ArrayList<>();
private final List<URL> classFiles = new ArrayList<>();
private final HashMap<String, String> 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.
*