Class ContentModel

java.lang.Object
javax.swing.text.html.parser.ContentModel
All Implemented Interfaces:
Serializable

public final class ContentModel extends Object implements Serializable
A representation of a content model. A content model is basically a restricted BNF expression. It is restricted in the sense that it must be deterministic. This means that you don't have to represent it as a finite state automaton.

See Annex H on page 556 of the SGML handbook for more information.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The content.
    The next content model (in a ',', '|' or '&' expression).
    int
    Type.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates ContentModel
    ContentModel(int type, Object content, ContentModel next)
    Create a content model of a particular type.
    ContentModel(int type, ContentModel content)
    Create a content model of a particular type.
    Create a content model for an element.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Return true if the content model could match an empty input stream.
    Return the element that must be next.
    boolean
    first(Object token)
    Return true if the token could potentially be the first token in the input stream.
    void
    Update elemVec with the list of elements that are part of the this contentModel.
    Convert to a string.

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
    Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
    boolean
    Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    May cause performance issues, deadlocks and hangs.
    final Class<? extends Object>
    Answers the unique instance of java.lang.Class which represents the class of the receiver.
    int
    Answers an integer hash code for the receiver.
    final void
    Causes one thread which is waiting on the receiver to be made ready to run.
    final void
    Causes all threads which are waiting on the receiver to be made ready to run.
    final void
    Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated by notify or notifyAll).
    final void
    wait(long time)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
    final void
    wait(long time, int frac)
    Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated by notify or notifyAll) or the expiration of the timeout.
  • Field Details

    • type

      public int type
      Type. Either '*', '?', '+', ',', '|', '&'.
    • content

      public Object content
      The content. Either an Element or a ContentModel.
    • next

      public ContentModel next
      The next content model (in a ',', '|' or '&' expression).
  • Constructor Details

    • ContentModel

      public ContentModel()
      Creates ContentModel
    • ContentModel

      public ContentModel(Element content)
      Create a content model for an element.
      Parameters:
      content - the element
    • ContentModel

      public ContentModel(int type, ContentModel content)
      Create a content model of a particular type.
      Parameters:
      type - the type
      content - the content
    • ContentModel

      public ContentModel(int type, Object content, ContentModel next)
      Create a content model of a particular type.
      Parameters:
      type - the type
      content - the content
      next - the next content model
  • Method Details

    • empty

      public boolean empty()
      Return true if the content model could match an empty input stream.
      Returns:
      true if the content model could match an empty input stream
    • getElements

      public void getElements(Vector<Element> elemVec)
      Update elemVec with the list of elements that are part of the this contentModel.
      Parameters:
      elemVec - the list of elements
    • first

      public boolean first(Object token)
      Return true if the token could potentially be the first token in the input stream.
      Parameters:
      token - the token
      Returns:
      true if the token could potentially be the first token in the input stream
    • first

      public Element first()
      Return the element that must be next.
      Returns:
      the element that must be next
    • toString

      public String toString()
      Convert to a string.
      Overrides:
      toString in class Object
      Returns:
      the string representation of this ContentModel