rejectednodewrapper.java

来自「java xml 应用开发」· Java 代码 · 共 84 行

JAVA
84
字号
import org.w3c.dom.Element;



class RejectedNodeWrapper extends DCOutputWrapper 
{
    public RejectedNodeWrapper(Element element)
    {
    	super(element);
    }

    protected String getID()
    {
        String strID;

        if (!m_Element.hasAttribute("ID"))
        {
            strID = "";
        }
        else
        {
            strID = " " + m_Element.getAttribute("ID");
        }
        return strID;
    }
    
    protected String getCaughtException()
    {
        String strCaughtException;

        if (!m_Element.hasAttribute("CaughtException"))
        {
        	strCaughtException = "";
        }
        else
        {
        	strCaughtException = " CaughtException: \"" + m_Element.getAttribute("CaughtException") + "\"";
        }
        return strCaughtException;
    }
    
    protected String getIsValid()
    {
    	String strValid = m_Element.getAttribute("IsValid");
        
        if (strValid != null && strValid.equals("false"))
        {
        	strValid = "  Is NOT Valid";
        }
        else
        {
        	strValid = "";
        }
        return strValid;
    }
    
    protected String getFitsType()
    {
    	String strFitsType = m_Element.getAttribute("FitsType");
        
        if (strFitsType != null && strFitsType.equals("false"))
        {
        	strFitsType = "  Process Type does not fit this Device";
        }
        else
        {
        	strFitsType = "";
        }
        return strFitsType;
    }
    
    
    public String toString()
    {
        String strNodeName = m_Element.getTagName();
        if (strNodeName.equals("RejectedNode") || strNodeName.equals("RejectedChildNode"))
            strNodeName = "JDF:";
        strNodeName += getID() // + getFormattedXPath() 
                    + getIsValid() + getCaughtException() 
                    + getFitsType() + getMessage();
        return strNodeName;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?