/** * Walk entries. * * @param handler * handler to call. * @throws IllegalArgumentException * if handler is null. */ public void walk( final Closure handler ) throws IllegalArgumentException { this.walk( handler, TruePredicate.INSTANCE ); }
/** * @param filter * filter to use. * @return matching key values. * @throws IllegalArgumentException * if filter is null. */ public List<KeyValue<?>> get( final Predicate filter ) throws IllegalArgumentException { final AddClosureArrayList<KeyValue<?>> result = new AddClosureArrayList<KeyValue<?>>(); this.walk( result, filter ); return result; }
/** * Read properties from preferences. */ public void readFromPreferences() { final Preferences node = Preferences.userNodeForPackage( this.getClass() ); this.getProperties().walk( new ReadFromPreferences( node ) ); }
/** * @param properties * properties. * @param handler * handler. * @throws KettleException * ... * @throws IllegalArgumentException * if properties is null. */ public static void walk( final KeyValueSet properties, final Closure handler ) throws KettleException, IllegalArgumentException { assertProperties( properties ); try { properties.walk( handler ); } catch ( FunctorException e ) { throw (KettleException) e.getCause(); } }
/** * Saves properties to preferences. * * @throws BackingStoreException * ... */ public void saveAsPreferences() throws BackingStoreException { final Preferences node = Preferences.userNodeForPackage( this.getClass() ); this.getProperties().walk( new SaveToPreferences( node ) ); node.flush(); }
/** * {@inheritDoc} * * @see org.pentaho.di.trans.step.StepMetaInterface#loadXML(org.w3c.dom.Node, java.util.List, java.util.Map) */ public void loadXML( final Node node, final List<DatabaseMeta> databaseMeta, final IMetaStore metaStore ) throws KettleXMLException { this.getProperties().walk( new LoadXml( node ) ); initDbMeta( databaseMeta ); }
/** * @param properties * properties * @return XML String * @throws IllegalArgumentException * if properties is null */ public static String toXml( final KeyValueSet properties ) throws IllegalArgumentException { assertProperties( properties ); final AppendXml handler = new AppendXml(); properties.walk( handler ); return handler.getXml(); }