Code example for Properties

Methods: get, remove

0
         
    	props.put("resources", new HashMap<String,String>());
         
    	CmdLineQuestion q3= new CmdLineMandatory("resproc", getResourceStr(rcb, "cmd.rest.resproc")) {
            protected String onAnswerSetOutput(String answer, Properties props) {
                Map<String,String> m = (Map<String,String>) props.get("resources");
                String uri= (String) props.remove("resuri");
                m.put(uri, answer);
                return "resptr"; 
            }}; 
        CmdLineQuestion q2= new CmdLineMandatory("resptr", getResourceStr(rcb,"cmd.rest.resptr")) {
            protected String onAnswerSetOutput(String answer, Properties props) {
                if (isEmpty(answer)) { return ""; }
                props.put("resuri", answer);
                return "resproc"; 
            }}; 
        final CmdLineQuestion q1= new CmdLineQuestion("ctx", getResourceStr(rcb, "cmd.http.ctx")) {
            protected String onAnswerSetOutput(String answer, Properties props) {
                props.put("contextpath", answer);
                return "resptr"; 
            }};