⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parseevent.java

📁 Mofire的JAR压缩包
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   ParseEvent.java

package org.kxml.parser;

import java.util.Vector;
import org.kxml.Attribute;

public class ParseEvent
{

	static final String WRONG_TYPE = "Method not supported for the given event type!";
	int lineNumber;
	int type;
	String text;

	public ParseEvent(int type, String text)
	{
		lineNumber = -1;
		this.type = type;
		this.text = text;
	}

	public int getLineNumber()
	{
		return lineNumber;
	}

	public int getType()
	{
		return type;
	}

	public void setLineNumber(int lineNumber)
	{
		this.lineNumber = lineNumber;
	}

	public Attribute getAttribute(int index)
	{
		return (Attribute)getAttributes().elementAt(index);
	}

	public Attribute getAttribute(String name)
	{
		return getAttribute("", name);
	}

	public Attribute getAttribute(String namespace, String name)
	{
		Vector attributes = getAttributes();
		int len = getAttributeCount();
		for (int i = 0; i < len; i++)
		{
			Attribute attr = (Attribute)attributes.elementAt(i);
			if (attr.getName().equals(name) && (namespace == null || namespace.equals(attr.getNamespace())))
				return attr;
		}

		return null;
	}

	public int getAttributeCount()
	{
		Vector a = getAttributes();
		return a != null ? a.size() : 0;
	}

	public Vector getAttributes()
	{
		throw new RuntimeException("Method not supported for the given event type!");
	}

	public String getName()
	{
		return null;
	}

	public String getNamespace()
	{
		return null;
	}

	public String getValue(String attrName)
	{
		Attribute attr = getAttribute(attrName);
		if (attr == null)
			throw new RuntimeException("Attribute " + attrName + " in " + this + " expected!");
		else
			return attr.getValue();
	}

	public String getValueDefault(String attrName, String deflt)
	{
		Attribute attr = getAttribute(attrName);
		return attr != null ? attr.getValue() : deflt;
	}

	public String getText()
	{
		return text;
	}

	public String toString()
	{
		return "ParseEvent type=" + type + " text='" + text + "'";
	}
}

⌨️ 快捷键说明

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