Package gov.nist.core

Examples of gov.nist.core.NameValue


            while (lexer.hasMoreChars()) {
              // If the URI is not enclosed in brackets, parameters belong to header
                if (lexer.lookAhead(0) != ';' || !inBrackets)
                    break;
                lexer.consume(1);
                NameValue parms = uriParam();
                if (parms != null) retval.setUriParameter(parms);
            }

            if (lexer.hasMoreChars() && lexer.lookAhead(0) == '?') {
                lexer.consume(1);
                while (lexer.hasMoreChars()) {
                    NameValue parms = qheader();
                    retval.setQHeader(parms);
                    if (lexer.hasMoreChars() && lexer.lookAhead(0) != '&')
                        break;
                    else
                        lexer.consume(1);
View Full Code Here


     */
    protected NameValue qheader() throws ParseException {
        String name = lexer.getNextToken('=');
        lexer.consume(1);
        String value = hvalue();
        return new NameValue(name, value, false);

    }
View Full Code Here

    }

    /** Set a parameter.
    */
    public void setParameter(String name, String value) throws ParseException {
        NameValue nv = parameters.getNameValue(name);
        if (nv != null) {
            nv.setValueAsObject(value);
        } else {
            nv = new NameValue(name, value);
            if (name.equalsIgnoreCase("methods"))
                nv.setQuotedValue();
            this.parameters.set(nv);
        }
    }
View Full Code Here

        if (debug)
            dbg_enter("parseParameter");
        try {

            NameValue nv = this.nameValue('=');
            
            //chargingFunctionAddresses.setParameter(nv);
            chargingFunctionAddresses.setMultiParameter(nv);

        } finally {
View Full Code Here

        throws ParseException
    {
        if (debug)
            dbg_enter("parseParameter");
        try {
            NameValue nv = this.nameValue('=');
            header.setParameter(nv);
        } finally {
            if (debug)
                dbg_leave("parseParameter");
        }
View Full Code Here

    public void setParameter(String name, String value) throws ParseException
    {
        if (value == null)
            throw new NullPointerException("null value");

        NameValue nv = super.parameters.getNameValue(name.toLowerCase());
        if (nv == null)
        {
            nv = new NameValue(name, value);

            // quoted values
            if (name.equalsIgnoreCase(ParameterNamesIms.D_VER))
            {
                nv.setQuotedValue();

                if (value.startsWith(Separators.DOUBLE_QUOTE))
                    throw new ParseException(value
                            + " : Unexpected DOUBLE_QUOTE", 0);
            }

            super.setParameter(nv);
        }
        else
        {
            nv.setValueAsObject(value);
        }

    }
View Full Code Here

    protected void parseParameter(PChargingVector chargingVector) throws ParseException {

        if (debug)
            dbg_enter("parseParameter");
        try {
            NameValue nv = this.nameValue('=');
            chargingVector.setParameter(nv);
        } finally {
            if (debug)
                dbg_leave("parseParameter");
        }
View Full Code Here

     */
    public ListIterator getChargingCollectionFunctionAddresses() {

        Iterator li = this.parameters.iterator();
        LinkedList ccfLIST = new LinkedList();
        NameValue nv;
        while (li.hasNext()) {
            nv = (NameValue) li.next();
            if (nv.getName().equalsIgnoreCase(ParameterNamesIms.CCF)) {

                NameValue ccfNV = new NameValue();

                ccfNV.setName(nv.getName());
                ccfNV.setValueAsObject(nv.getValueAsObject());

                ccfLIST.add(ccfNV);

            }
        }
View Full Code Here

      LinkedList<NameValue> listw = new LinkedList<NameValue>();
  
        Iterator li = this.parameters.iterator();
        ListIterator<NameValue> ecfLIST = listw.listIterator();
        NameValue nv;
        boolean removed = false;
        while (li.hasNext()) {
            nv = (NameValue) li.next();
            if (nv.getName().equalsIgnoreCase(ParameterNamesIms.ECF)) {

                NameValue ecfNV = new NameValue();

                ecfNV.setName(nv.getName());
                ecfNV.setValueAsObject(nv.getValueAsObject());

                ecfLIST.add(ecfNV);

            }
        }
View Full Code Here

     * @param name - of the parameter
     * @return true if parameter was removed, and false if not
     */
    public boolean delete(String value, String name) {
        Iterator li = this.parameters.iterator();
        NameValue nv;
        boolean removed = false;
        while (li.hasNext()) {
            nv = (NameValue) li.next();
            if (((String) nv.getValueAsObject()).equalsIgnoreCase(value) && nv.getName().equalsIgnoreCase(name)) {
                li.remove();
                removed = true;
            }
        }

View Full Code Here

TOP

Related Classes of gov.nist.core.NameValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.