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 javax.xml.stream.events.Attribute;

public class Main {
    /**
     * Give the String representation of an Attribute name.
     * 
     * @param pAttribute
     *            the attribute
     * @return String representation of the attribute name.
     */
    public static String attributeNameToString(Attribute pAttribute) {
        StringBuffer fullAttribute = new StringBuffer();
        if (pAttribute.getName().getPrefix() != null) {
            fullAttribute.append(pAttribute.getName().getPrefix());
            fullAttribute.append(":");
        }
        fullAttribute.append(pAttribute.getName().getLocalPart());
        return fullAttribute.toString();
    }
}