Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import org.w3c.dom.Element;

public class Main {
    public static int readIntegerAttribute(Element elem, String name, int defaultValue) {
        int back = defaultValue;

        String str = elem.getAttribute(name);
        if (str != null) {
            if (str.length() > 0) {
                back = Integer.parseInt(str);
            }
        }

        return back;
    }
}