org.capml.quasi
Class QuasiContent

java.lang.Object
  |
  +--org.capml.quasi.QuasiContent
All Implemented Interfaces:
Marker, MatchMaker, PassByConstruction, Persistent, Selfless, Serializable
Direct Known Subclasses:
QuasiContentExprHole, QuasiContentList, QuasiContentPattHole, QuasiElement, QuasiText

Deprecated. Use Term trees instead.

public abstract class QuasiContent
extends Object
implements Persistent, Selfless, PassByConstruction, MatchMaker

Untamed: Represents a quasi-literal list of dom Nodes.

We define "Content" to be either a concrete Node, or a ConstList of concrete Nodes. The latter we also define as a "ContentList". As a ValueMaker, a QuasiContent will evaluate to a ContentList. As a MatchMaker, it will match against Content, and either succeed, extracting values, or fail. The Minimal-XML quasi-parser produces a QuasiContent.

Author:
Mark S. Miller
See Also:
Serialized Form

Field Summary
(package private) static long serialVersionUID
          Deprecated.  
 
Fields inherited from interface org.erights.e.elib.serial.Persistent
HONORARY, HONORED_NAMES
 
Fields inherited from interface org.erights.e.elib.tables.Selfless
HONORARY, HONORED_NAMES
 
Fields inherited from interface org.erights.e.elib.serial.PassByConstruction
HONORARY, HONORED_NAMES
 
Constructor Summary
QuasiContent()
          Deprecated. Enabled:
 
Method Summary
 void __printOn(TextWriter out)
          Deprecated. Enabled: Prints as "sml`...`", where pretty printed quasi-XML appears between the backquotes
(package private) static void bind(FlexList bindings, int index, Object value)
          Deprecated. A convenience for placing @-hole matches into bindings.
 ConstList matchBind(ConstList args, Object specimen)
          Deprecated. Enabled: As a MatchMaker, while using the args to fill in the $-holes, pattern match against the specimen, which must be Content or String, and return the list of values extracted by @-holes.
abstract  boolean matchBind(ConstList args, Object specimen, FlexList bindings)
          Deprecated. Enabled: As a MatchMaker, while using the args to fill in the $-holes, pattern match against the specimen, which must be Content, and put the values ( extracted by the @-holes into 'bindings'.
(package private) static Node optTheOne(Object content)
          Deprecated. If content represents a single Node, return it.
abstract  void prettyPrintOn(TextWriter out)
          Deprecated. Enabled: Prints pretty printed quasi-XML
abstract  Object substitute(Object[] args)
          Deprecated. Enabled: As a ValueMaker, given a list of args, use each arg to fill in the corresponding $-hole, and return the resulting concrete Content -- either a Node or a ConstList of Nodes.
(package private) static Object toContent(Object content)
          Deprecated. Coerce 'content', which must be Content (as defined in the class comment) or a String into a Content (as also defined there).
(package private) static ConstList toContentList(Object content)
          Deprecated. Coerce 'content', which must be Content (as defined in the class comment) or a String into a ContentList (as also defined there).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.erights.e.elib.tables.Selfless
getSpreadUncall
 

Field Detail

serialVersionUID

static final long serialVersionUID
Deprecated. 
Constructor Detail

QuasiContent

public QuasiContent()
Deprecated. 
Enabled:

Method Detail

toContentList

static ConstList toContentList(Object content)
Deprecated. 
Coerce 'content', which must be Content (as defined in the class comment) or a String into a ContentList (as also defined there).

If 'content' is a Node, a singleton list containing that Node is returned. If it's a String, a singleton list of a Text on that String is returned. Otherwise, content must be a ConstList of Nodes, and is returned.


optTheOne

static Node optTheOne(Object content)
Deprecated. 
If content represents a single Node, return it. If it's a String, return the corresponding Text. Otherwise return null. If content isn't valid Content, it's ok to throw an exception instead of returning null.


toContent

static Object toContent(Object content)
Deprecated. 
Coerce 'content', which must be Content (as defined in the class comment) or a String into a Content (as also defined there).

If 'content' is a Node, it's returned. If it's a String, a Text on that String is returned. Otherwise, it must be a ConstList of Nodes. If it's a singleton list, it's one member is returned. Otherwise the list is returned.


bind

static void bind(FlexList bindings,
                 int index,
                 Object value)
Deprecated. 
A convenience for placing @-hole matches into bindings. XXX Note that it will not detect multiple stores of null to the same index.


substitute

public abstract Object substitute(Object[] args)
Deprecated. 
Enabled: As a ValueMaker, given a list of args, use each arg to fill in the corresponding $-hole, and return the resulting concrete Content -- either a Node or a ConstList of Nodes.

The args and return value must be concrete (not quasi). If it's filling in an Element tagName, the arg must be a String. Otherwise it may be either a String or Content.


matchBind

public ConstList matchBind(ConstList args,
                           Object specimen)
Deprecated. 
Enabled: As a MatchMaker, while using the args to fill in the $-holes, pattern match against the specimen, which must be Content or String, and return the list of values extracted by @-holes.

If the match fails, return null. The args, specimen, and return value must be concrete. The args must follow the same rules as the args to substitute(). The specimen may be either Content or String. The returned list of values extracted by

Specified by:
matchBind in interface MatchMaker

matchBind

public abstract boolean matchBind(ConstList args,
                                  Object specimen,
                                  FlexList bindings)
Deprecated. 
Enabled: As a MatchMaker, while using the args to fill in the $-holes, pattern match against the specimen, which must be Content, and put the values ( extracted by the @-holes into 'bindings'.

Returns whether the match succeeded. The args, specimen, and the values put into bindings must be concrete. The args must follow the same rules as the args to substitute(). The specimen may be either Content or String. The values extracted by @-holes are Strings, if they were extracted by a tagName @-hole, or a Content, if they were extracted by an @-hole in content position.

Specified by:
matchBind in interface MatchMaker

__printOn

public void __printOn(TextWriter out)
               throws IOException
Deprecated. 
Enabled: Prints as "sml`...`", where pretty printed quasi-XML appears between the backquotes

IOException

prettyPrintOn

public abstract void prettyPrintOn(TextWriter out)
                            throws IOException
Deprecated. 
Enabled: Prints pretty printed quasi-XML

IOException


comments?