Acts as the token type for HTML comments.
netscape.plugin.composer.io package
java.lang.Object
In the Composer Plug-in API, HTML comments have this form:
'<!' + commentText + '>'
This table summarizes Comment class methods:
Constructor | Description | |
---|---|---|
Comment(String) | Creates an instance of the Comment class from a string | |
Comment(StringBuffer) | Creates an instance of the Comment class from a string buffer | |
Methods | Description | |
createSelectionEnd() | Creates a selection end comment | |
createSelectionEnd( boolean) |
Creates a selection end comment | |
createSelectionStart() | Creates a selection start comment | |
createSelectionStart( boolean) |
Creates a selection start comment | |
equals(Object) | Performs equality test | |
getText() | Gets the text of the comment | |
hashCode() | Computes the hash code for the comment | |
isSelection() | Checks whether this comment is a selection comment | |
isSelectionEnd() | Checks whether this comment is a selection end comment | |
isSelectionStart() | Checks whether this comment is a selection start comment | |
isSelectionStickyAfter() | Checks whether this comment is a sticky-after selection comment | |
toString() | Returns the full HTML representation of the comment, including the opening "<!" and closing ">" |
Entity, JavaScriptEntity, LexicalStream, SelectedHTMLReader, Tag, Text, Token, Reader
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Creates an instance of the Comment class from a string buffer.
Comment class
public Comment(StringBuffer buf)
buf |
Text of the comment. Does not include the '!' at the start of the comment. |
The buf parameter represents text that can be changed during processing.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Creates an instance of the Comment class from a string.
Comment class
public Comment(String text)
text |
The text of the comment. Does not include the '!' at the start of the comment. |
The text parameter represents static text that does not change during processing.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Creates a selection end comment.
Comment class
public static Comment createSelectionEnd()
This function places the end comment after the last piece of text you to select. It is equivalent to:
createSelectionEnd(false);
Canonical selection end comment.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Creates a selection end comment.
Comment class
public static Comment createSelectionEnd(boolean stickyAfter);
stickyAfter |
Whether the selection end sticks to the
next token.
|
This function places the end comment before the first piece of text you to select. It is equivalent to:
createSelectionStart(false);
For more information, see isSelectionStickyAfter.
Selection end comment.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Creates a selection start comment.
Comment class
public static Comment createSelectionStart()
This function inserts a selection start comment before the first piece of text to select. It is equivalent to:
createSelectionEnd(false);
Canonical selection start comment.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Creates a selection start comment.
Comment class
public static Comment createSelectionStart(boolean stickyAfter)
stickyAfter |
Whether the selection start sticks to the
next token.
|
For more information, see isSelectionStickyAfter.
Selection start comment.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Performs an equality test.
Comment class
public boolean equals(Object other)
other |
The text to compare with this text for equality |
This function overrides the equals function in the Object class.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Copies the comment to the document.
Comment class
public String getText()
This function copies the comment to the document. The returned text does not include the '!' at the start of the comment.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Computes the hash code for the comment.
Comment class
public int hashCode()
The hash code of the comment. For more information, see JavaScriptEntity.hashCode.
This function overrides the hashCode function in the Object class.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Checks whether this comment is a selection comment.
Comment class
public boolean isSelection()
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Checks whether this comment is a selection end comment.
Comment class
public boolean isSelectionEnd()
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Checks whether this comment is a selection start comment.
Comment class
public boolean isSelectionStart()
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Checks whether this comment has the sticky-after property.
Comment class
public boolean isSelectionStickyAfter()
The stickyAfter property is used in undo operations to make sure that the document returns to its exact previous state after an undo. You almost never need to set this value. When included, it tells where the cursor should land in relationship to the line break after an undo when text is broken across two lines.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Returns the full HTML representation of the comment, including the opening "<!" and the closing ">".
Comment class
public String toString()
This function overrides the toString function in the Object class.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Represents an entity, a multicharacter combination that starts with '&' and ends with ';'.
netscape.plugin.composer.io package
netscape.plugin.composer.io.Token
Entities serve two purposes:
This table summarizes Entity class methods:
Constructor | Description |
---|---|
Entity(String, char) | Creates an instance of the Entity class from a string and a value |
Entity(StringBuffer) | Creates an instance of the Entity class from a string buffer |
Method | Description |
entities() | Enumerates the known entities |
equals(Object) | Performs an equality test |
evaluate() | Internal function that evaluates the entity |
getValue() | Gets the value of the entity |
hashCode() | Gets the hash code representation of the entity |
toString() | Gets the HTML representation of the entity |
Comment, JavaScriptEntity, Token
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Creates an instance of the Entity class from a string and a value.
Entity class
public Entity(String s, char c)
s |
String from which to create an entity |
c | Value from which to create an entity |
You use this function to build up an internal list of legal entities.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Creates an instance of the Entity class from a string buffer.
Entity class
public Entity(StringBuffer s)
s |
String buffer from which to create an entity |
Entity instances have a value of -1 while the plug-in is running. The s parameter represents text that can be changed during processing.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Enumerates the known entities.
Entity class
public static Enumeration entities()
Several entities with the same value may exist.
An enumeration of the known standard entities.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Performs an equality test.
Entity class
public boolean equals(Object other)
other |
String to test for equality with this entity |
This function overrides the equals function in the Object class.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Evaluates the entity.
Entity class
protected int evaluate()
This internal function actually evaluates the entity. About 57 possible entities exist, for example:
;=&mbsp; 0xa0 160
The function returns -1 if the entity is unknown.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Gets the value for the entity.
Entity class
public int getValue()
The unicode value of the entity or -1 if the entity is unknown.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Computes the hash code for the entity.
Entity class
public int hashCode()
The hash code for the entity. For more information, see JavaScriptEntity.hashCode.
This function overrides the hashCode function in the Object class.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Gets the HTML string representation of the entity.
Entity class
public String toString()
The HTML string representation of the entity.
This function overrides the toString function in the Object class.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Represents runtime scriptable tag parameters.
netscape.plugin.composer.io package
netscape.plugin.composer.io.Token
A JavaScript entity is an HTML expression of the form:
"&{" javascriptEntity "};"
A JavaScript entity is used to provide runtime evaluation of the value of parameters. The value of the JavaScript entity cannot be known during plug-in design (in the editor).
This table summarizes JavaScriptEntity class methods:
Constructor | Description |
---|---|
JavaScriptEntity (StringBuffer) |
Creates an instance of the JavaScriptEntity class |
Method | Description |
equals(Object) | Performs an equality test |
getScript() | Gets the JavaScript associated with the entity |
hashCode() | Gets the hash code representation of the JavaScript entity |
toString() | Gets the HTML string representation of the JavaScript entity |
Comment, Entity, LexicalStream, SelectedHTMLReader, Tag, Text, Token
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Creates an instance of the JavaScriptEntity class.
JavaScriptEntity class
public JavaScriptEntity(StringBuffer buf)
buf |
Text of the comment. Does not include the '!' at the start of the comment. |
The JavaScriptEntity class represents runtime scriptable tag parameters. The buf parameter represents text that can be changed during processing.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Performs an equality test
JavaScriptEntity class
public boolean equals(Object other)
other |
Object to test for equality |
Equality means that the expression strings are identical, but does not mean that the result of the expressions is equal. The JavaScriptEntity class includes both the hashCode and equals methods in order to take advantage of Java hashtable functionality. For information about the way that Java uses hashtables, see your Java documentation.
This function overrides the equals function in the Object class.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Gets the JavaScript associated with the entity.
JavaScriptEntity class
public String getScript()
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Gets the hash code representation of the JavaScript entity
JavaScriptEntity class
public int hashCode()
This method returns a hash code representation of the JavaScript entity, which can be used in Java hashtables. A hashtable maps the keys of records to hash code values, and is used as a data access device. To take advantage of hashtable functionality, an object must implement both the hashCode and equals methods. For information about the way that Java uses hashtables, see your Java documentation.
The hash code representation of the JavaScript entity.
This function overrides the hashCode function in the Object class.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Gets the HTML string representation of the JavaScript entity
JavaScriptEntity class
public String toString()
The HTML string representation of the JavaScript entity.
This function overrides the toString function in the Object class.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Represents an HTML lexical stream.
netscape.plugin.composer.io package
java.lang.Object
This class breaks a Reader object into lexical tokens.
This table summarizes LexicalStream class methods:
Constructor | Description |
---|---|
LexicalStream(Reader) | Creates an instance of the LexicalStream class from a Reader object |
LexicalStream(String) | Creates an instance of the LexicalStream from a Unicode string |
Method | Description |
next() | Returns the next token in an HTML input stream |
Comment, Entity, JavaScriptEntity, SelectedHTMLReader, Tag, Text, Token, Reader
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Creates an instance of the LexicalStream class from a Reader object.
LexicalStream class
public LexicalStream(Reader in)
in |
Input stream |
The stream's close method is called automatically when next returns null, that is, when the iterator finishes delivering tokens.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Creates an instance of the LexicalStream class from a Unicode string.
LexicalStream class
public LexicalStream(String in)
in |
Input string |
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Returns the next token in an HTML input stream.
LexicalStream class
public Token next() throws IOException
Tokenizing is the process of repeatedly calling next to return tokens. Note that \r\n is considered a distinct token, even though the \r is dropped.
Returns the next token in the stream, or null if the input stream has run out of tokens.
IOException
The Composer Plug-in API uses standard Java exceptions and exception handling. For more information, see your Java documentation.
[Top] [IO Package Classes] [Composer Plug-in API Reference]
Copyright © 1997 Netscape Communications Corporation