SmartFrog 3.10.000

org.smartfrog.sfcore.parser
Interface Parser

All Superinterfaces:
StreamParser
All Known Implementing Classes:
SFParser

public interface Parser
extends StreamParser

Defines the main parser interface. Adds the ability to parse strings as well as streams.


Method Summary
 Phases sfParse(java.lang.String str)
          Parses component(s) from a string.
 java.lang.Object sfParseAnyValue(java.lang.String txt)
          Parses any value from a string.
 ComponentDescription sfParseComponentDescription(java.lang.String txt)
          Parses a component description from a string.
 java.lang.Object sfParsePrimitiveValue(java.lang.String txt)
          Parses a primitive value from a string.
 Reference sfParseReference(java.lang.String txt)
          Parses a reference from a string.
 Phases sfParseResource(java.lang.String url)
          Parses component(s) from an resource url.
 
Methods inherited from interface org.smartfrog.sfcore.parser.StreamParser
sfParse, sfParse, sfParseAnyValue, sfParseComponentDescription, sfParsePrimitiveValue, sfParseReference
 

Method Detail

sfParse

Phases sfParse(java.lang.String str)
               throws SmartFrogParseException
Parses component(s) from a string. Returns the root component. This is a utility access method which currently does not support localization.

Parameters:
str - string to parse
Returns:
root component containing parsed component(s)
Throws:
SmartFrogParseException - error parsing string

sfParseResource

Phases sfParseResource(java.lang.String url)
                       throws SmartFrogParseException
Parses component(s) from an resource url. Returns a root component which contains the parsed components. Includes should be handled by some default include handler.

Parameters:
url - url to resource to parse and compile from
Returns:
root component containing parsed component(s)
Throws:
SmartFrogParseException - error parsing stream

sfParseReference

Reference sfParseReference(java.lang.String txt)
                           throws SmartFrogCompilationException
Parses a reference from a string. Used by components and developers to quickly build references from a string (eg. sfResolve in Prim)

Parameters:
txt - textual representation of the reference
Returns:
parsed reference
Throws:
SmartFrogParseException - failed to parse reference
SmartFrogCompilationException

sfParseAnyValue

java.lang.Object sfParseAnyValue(java.lang.String txt)
                                 throws SmartFrogCompilationException
Parses any value from a string. (the meaning of "any" is language dependant)

Parameters:
txt - string to parse for a value
Returns:
parsed value
Throws:
SmartFrogParseException - failed to parse any value
SmartFrogCompilationException

sfParsePrimitiveValue

java.lang.Object sfParsePrimitiveValue(java.lang.String txt)
                                       throws SmartFrogCompilationException
Parses a primitive value from a string. (the meaning of primitive is language dependant)

Parameters:
txt - string to parse for a value
Returns:
parsed value
Throws:
SmartFrogParseException - failed to parse primtiive value
SmartFrogCompilationException

sfParseComponentDescription

ComponentDescription sfParseComponentDescription(java.lang.String txt)
                                                 throws SmartFrogCompilationException
Parses a component description from a string. All the langauge phases will have been applied, and the conversion to ComponentDescription carried out.

Parameters:
txt - input to parse for a value
Returns:
parsed component description
Throws:
SmartFrogParseException - failed to parse primtiive value
SmartFrogCompilationException

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP