/** * Returns a copy of the parameters object. */ public Object clone() { SourceParameters newObject = new SourceParameters(); Iterator names = this.getParameterNames(); Iterator values; String name, value; while( names.hasNext() ) { name = (String)names.next(); values = this.getParameterValues( name ); while( values.hasNext() ) { value = (String)values.next(); newObject.setParameter( name, value ); } } return newObject; }
/** * Create a map object. * The first value of each parameter is added to the map. * @return A new map - if no parameters are defined this is an * empty map. */ public Map getFirstParametersMap() { final Map result = new HashMap(); Iterator iter = this.getParameterNames(); String parName; while( iter.hasNext() ) { parName = (String)iter.next(); result.put( parName, this.getParameter( parName ) ); } return result; }
/** * Set the value of this parameter to the given value. * Remove all other values for this parameter. */ public void setSingleParameterValue( String name, String value ) { this.removeParameter( name ); this.setParameter( name, value ); }
/** * Add all parameters from the incoming parameters object. */ public void add( SourceParameters parameters ) { if( null != parameters ) { Iterator names = parameters.getParameterNames(); Iterator values; String name; String value; while( names.hasNext() == true ) { name = (String)names.next(); values = parameters.getParameterValues( name ); while( values.hasNext() == true ) { value = (String)values.next(); this.setParameter( name, value ); } } } }
index = uri.indexOf('?'); if (index != -1) { sp = new SourceParameters(uri.substring(index + 1)); uri = uri.substring(0, index); SourceParameters remainingParameters = (SourceParameters) sp.clone(); final Iterator names = sp.getParameterNames(); while (names.hasNext()) { String name = (String) names.next(); if (name.startsWith("cocoon:cache")) { params.setParameter(name.substring("cocoon:".length()), sp.getParameter(name)); remainingParameters.removeParameter(name); String queryString = remainingParameters.getEncodedQueryString(); if (queryString != null) { uri += "?" + queryString;
if( children != null && children.length > 0 ) SourceParameters pars = new SourceParameters(); String name; String value; pars.setParameter( name, value );
Iterator keys = parameters.getParameterNames(); String current; char separator = ( uri.indexOf( "?" ) == -1 ? '?' : '&' ); values = parameters.getParameterValues( current ); while( values.hasNext() == true )
if (null != m_parameters && m_parameters.hasParameters() && !m_isPost) final Iterator i = m_parameters.getParameterNames(); Iterator values; String value; values = m_parameters.getParameterValues(key); while (values.hasNext() == true)
/** * Construct a new object from a queryString */ public SourceParameters( String queryString ) { if( queryString != null ) { StringTokenizer st = new StringTokenizer( queryString, "&" ); while( st.hasMoreTokens() ) { String pair = st.nextToken(); int pos = pair.indexOf( '=' ); if( pos != -1 ) { setParameter( parseName( pair.substring( 0, pos ) ), parseName( pair.substring( pos + 1, pair.length() ) ) ); } } } }
if( children != null && children.length > 0 ) SourceParameters pars = new SourceParameters(); String name; String value; pars.setParameter( name, value );
Iterator names = this.getParameterNames(); String name; boolean firstName = true; values = this.getParameterValues( name ); firstValue = true; while( values.hasNext() == true )
/** * Create a Parameters object. * The first value of each parameter is added to the Parameters object. * @return An Parameters object - if no parameters are defined this is an * empty object. */ public static Parameters getFirstParameters(SourceParameters params) { Parameters result = new Parameters(); Iterator iter = params.getParameterNames(); String parName; while( iter.hasNext() ) { parName = (String)iter.next(); result.setParameter( parName, params.getParameter( parName ) ); } return result; }
this.resourceParameters = new SourceParameters(); if (label.equals("value")) value = (String)stack.pop(); if (key != null && value != null) { this.resourceParameters.setParameter(key, value); key = null; value = null;
for ( final Iterator names = params.getParameterNames(); names.hasNext(); for ( final Iterator values = params.getParameterValues( name ); values.hasNext();
/** * Create a Parameters object. * The first value of each parameter is added to the Parameters object. * @deprecated Use {@link AvalonSourceUtil#getFirstParameters(SourceParameters)} or * {@link #getFirstParametersMap}. * @return An Parameters object - if no parameters are defined this is an * empty object. */ public Parameters getFirstParameters() { Parameters result = new Parameters(); Iterator iter = this.getParameterNames(); String parName; while( iter.hasNext() ) { parName = (String)iter.next(); result.setParameter( parName, this.getParameter( parName ) ); } return result; }
Iterator i = m_parameters.getParameterNames(); Iterator values; String value; values = m_parameters.getParameterValues(key); while (values.hasNext() == true)