/*
 * Decompiled with CFR 0_110.
 * 
 * Could not load the following classes:
 *  java.io.PrintStream
 *  java.io.Serializable
 *  java.lang.Class
 *  java.lang.ClassNotFoundException
 *  java.lang.Exception
 *  java.lang.NoClassDefFoundError
 *  java.lang.Number
 *  java.lang.Object
 *  java.lang.String
 *  java.lang.StringBuffer
 *  java.lang.System
 */
package org.dom4j.swing;

import java.io.PrintStream;
import java.io.Serializable;
import org.dom4j.DocumentHelper;
import org.dom4j.Node;
import org.dom4j.XPath;

public class XMLTableColumnDefinition
implements Serializable {
    public static final int NODE_TYPE = 3;
    public static final int NUMBER_TYPE = 2;
    public static final int OBJECT_TYPE = 0;
    public static final int STRING_TYPE = 1;
    static Class class$java$lang$Number;
    static Class class$java$lang$Object;
    static Class class$java$lang$String;
    static Class class$org$dom4j$Node;
    private XPath columnNameXPath;
    private String name;
    private int type;
    private XPath xpath;

    public XMLTableColumnDefinition() {
    }

    public XMLTableColumnDefinition(String string2, String string3, int n) {
        this.name = string2;
        this.type = n;
        this.xpath = this.createXPath(string3);
    }

    public XMLTableColumnDefinition(String string2, XPath xPath, int n) {
        this.name = string2;
        this.xpath = xPath;
        this.type = n;
    }

    public XMLTableColumnDefinition(XPath xPath, XPath xPath2, int n) {
        this.xpath = xPath2;
        this.columnNameXPath = xPath;
        this.type = n;
    }

    static Class class$(String string2) {
        try {
            Class class_ = Class.forName((String)string2);
            return class_;
        }
        catch (ClassNotFoundException var1_2) {
            throw new NoClassDefFoundError(var1_2.getMessage());
        }
    }

    public static int parseType(String string2) {
        if (string2 != null && string2.length() > 0) {
            if (string2.equals((Object)"string")) {
                return 1;
            }
            if (string2.equals((Object)"number")) {
                return 2;
            }
            if (string2.equals((Object)"node")) {
                return 3;
            }
        }
        return 0;
    }

    protected XPath createXPath(String string2) {
        return DocumentHelper.createXPath(string2);
    }

    public Class getColumnClass() {
        switch (this.type) {
            default: {
                Class class_;
                if (class$java$lang$Object != null) break;
                class$java$lang$Object = class_ = XMLTableColumnDefinition.class$("java.lang.Object");
                return class_;
            }
            case 1: {
                if (class$java$lang$String == null) {
                    Class class_;
                    class$java$lang$String = class_ = XMLTableColumnDefinition.class$("java.lang.String");
                    return class_;
                }
                return class$java$lang$String;
            }
            case 2: {
                if (class$java$lang$Number == null) {
                    Class class_;
                    class$java$lang$Number = class_ = XMLTableColumnDefinition.class$("java.lang.Number");
                    return class_;
                }
                return class$java$lang$Number;
            }
            case 3: {
                if (class$org$dom4j$Node == null) {
                    Class class_;
                    class$org$dom4j$Node = class_ = XMLTableColumnDefinition.class$("org.dom4j.Node");
                    return class_;
                }
                return class$org$dom4j$Node;
            }
        }
        return class$java$lang$Object;
    }

    public XPath getColumnNameXPath() {
        return this.columnNameXPath;
    }

    public String getName() {
        return this.name;
    }

    public int getType() {
        return this.type;
    }

    public Object getValue(Object object) {
        switch (this.type) {
            default: {
                return this.xpath.evaluate(object);
            }
            case 1: {
                return this.xpath.valueOf(object);
            }
            case 2: {
                return this.xpath.numberValueOf(object);
            }
            case 3: 
        }
        return this.xpath.selectSingleNode(object);
    }

    public XPath getXPath() {
        return this.xpath;
    }

    protected void handleException(Exception exception) {
        System.out.println(new StringBuffer().append("Caught: ").append((Object)exception).toString());
    }

    public void setColumnNameXPath(XPath xPath) {
        this.columnNameXPath = xPath;
    }

    public void setName(String string2) {
        this.name = string2;
    }

    public void setType(int n) {
        this.type = n;
    }

    public void setXPath(XPath xPath) {
        this.xpath = xPath;
    }
}

