Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
import org.xml.sax.Attributes;

public class Main {
    static public final String URL_DECODE_TYPE = "UTF-8";

    public static void DoConvertAttrsToStringMap(Attributes atts, HashMap<String, String> MapDest) {
        for (int attrsIndex = 0; attrsIndex < atts.getLength(); attrsIndex++) {
            String AttrName = atts.getLocalName(attrsIndex);
            String AttrValue = atts.getValue(attrsIndex);
            try {
                AttrValue = URLDecoder.decode(AttrValue, URL_DECODE_TYPE);
                MapDest.put(AttrName, AttrValue);
            } catch (UnsupportedEncodingException e) {
                // TODO
            }

            //Log.w("FCXML", "DoConvertAttrsToStringMap: Index: " + attrsIndex + " Name: " + AttrName + " Value " + AttrValue );
        }
    }
}