JavaTM Platform
Standard Ed. 6

javax.swing.text.html.parser
类 ContentModel

java.lang.Object
  继承者 javax.swing.text.html.parser.ContentModel
所有已实现的接口:
Serializable

public final class ContentModel
     
extends Object
implements Serializable

内容模式的表示形式。内容模式基本上是一个受限制的 BNF 表达式。受限制从某种意义上来说就是,它必须是确定的。这意味着您不必将它表示为一个有限状态自动机。

有关更多信息,请参阅 SGML 手册第 556 页中的 Annex H 内容。


字段摘要
 Object content
          内容。
 ContentModel next
          下一个内容模式(使用 ','、'|' 或 '&' 表达式)。
 int type
          类型。
 
构造方法摘要
ContentModel()
           
ContentModel(Element content)
          为元素创建一个内容模式。
ContentModel(int type, ContentModel content)
          创建一个特定类型的内容模式。
ContentModel(int type, Object content, ContentModel next)
          创建一个特定类型的内容模式。
 
方法摘要
 boolean empty()
          如果内容模式可以匹配一个空输入流,则返回 true。
 Element first()
          返回必须具有下一个的元素。
 boolean first(Object token)
          如果标记可能为输入流中第一个标记,则返回 true。
 void getElements(Vector<Element> elemVec)
          使用作为此 contentModel 一部分的元素列表更新 elemVec。
 String toString()
          转换为字符串。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

type

public int type
类型。可以是 '*'、'?'、'+'、','、'|'、'&'。


content

public Object content
内容。可以是一个 Element 或者一个 ContentModel。


next

public ContentModel next
下一个内容模式(使用 ','、'|' 或 '&' 表达式)。

构造方法详细信息

ContentModel

public ContentModel()

ContentModel

public ContentModel(Element content)
为元素创建一个内容模式。


ContentModel

public ContentModel(int type,
                    ContentModel content)
创建一个特定类型的内容模式。


ContentModel

public ContentModel(int type,
                    Object content,
                    ContentModel next)
创建一个特定类型的内容模式。

方法详细信息

empty

public boolean empty()
如果内容模式可以匹配一个空输入流,则返回 true。


getElements

public void getElements(Vector<Element> elemVec)
使用作为此 contentModel 一部分的元素列表更新 elemVec。


first

public boolean first(Object token)
如果标记可能为输入流中第一个标记,则返回 true。


first

public Element first()
返回必须具有下一个的元素。


toString

public String toString()
转换为字符串。

覆盖:
Object 中的 toString
返回:
该对象的字符串表示形式。

JavaTM Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策