/** * The factory method. A lookup is performed based on the type of the * provided value, as this is returned by "getClass().getName()". If a * match is found the call is delegated to the returned maker. **/ public VariableBinding make(String oid, Object value) throws MappingFailedException { // Get value type and locate the maker String type = value.getClass().getName(); Maker m = (Maker)this.makers.get(type); // Delegate where type match is found. If not use generic varbind maker if (m == null) { log.warn("Value type \"" + type + "\" for OID " + oid + " encountered. Using default VarBind maker"); return defaultMaker.make(oid, value); } else return m.make(oid, value); }
/** * The factory method. A lookup is performed based on the type of the * provided value, as this is returned by "getClass().getName()". If a * match is found the call is delegated to the returned maker. **/ public VariableBinding make(String oid, Object value) throws MappingFailedException { // Get value type and locate the maker String type = value.getClass().getName(); Maker m = (Maker)this.makers.get(type); // Delegate where type match is found. If not use generic varbind maker if (m == null) { log.warn("Value type \"" + type + "\" for OID " + oid + " encountered. Using default VarBind maker"); return defaultMaker.make(oid, value); } else return m.make(oid, value); }