HTMLPurifier_TokenFactory Class Reference

Factory for token generation. More...

List of all members.

Public Member Functions

 __construct ()
 Generates blank prototypes for cloning.
 createStart ($name, $attr=array())
 Creates a HTMLPurifier_Token_Start.
 createEnd ($name)
 Creates a HTMLPurifier_Token_End.
 createEmpty ($name, $attr=array())
 Creates a HTMLPurifier_Token_Empty.
 createText ($data)
 Creates a HTMLPurifier_Token_Text.
 createComment ($data)
 Creates a HTMLPurifier_Token_Comment.
 __construct ()
 Generates blank prototypes for cloning.
 createStart ($name, $attr=array())
 Creates a HTMLPurifier_Token_Start.
 createEnd ($name)
 Creates a HTMLPurifier_Token_End.
 createEmpty ($name, $attr=array())
 Creates a HTMLPurifier_Token_Empty.
 createText ($data)
 Creates a HTMLPurifier_Token_Text.
 createComment ($data)
 Creates a HTMLPurifier_Token_Comment.

Private Attributes

 $p_start
 Prototypes that will be cloned.
 $p_end
 $p_empty
 $p_text
 $p_comment


Detailed Description

Factory for token generation.

Note:
Doing some benchmarking indicates that the new operator is much slower than the clone operator (even discounting the cost of the constructor). This class is for that optimization. Other then that, there's not much point as we don't maintain parallel HTMLPurifier_Token hierarchies (the main reason why you'd want to use an abstract factory).
Todo:
Port DirectLex to use this
Note:
Doing some benchmarking indicates that the new operator is much slower than the clone operator (even discounting the cost of the constructor). This class is for that optimization. Other then that, there's not much point as we don't maintain parallel HTMLPurifier_Token hierarchies (the main reason why you'd want to use an abstract factory).
Todo:
Port DirectLex to use this

Definition at line 14 of file TokenFactory.php.


Constructor & Destructor Documentation

HTMLPurifier_TokenFactory::__construct (  ) 

Generates blank prototypes for cloning.

Definition at line 27 of file TokenFactory.php.

HTMLPurifier_TokenFactory::__construct (  ) 

Generates blank prototypes for cloning.

Definition at line 5996 of file HTMLPurifier.standalone.php.


Member Function Documentation

HTMLPurifier_TokenFactory::createStart ( name,
attr = array() 
)

Creates a HTMLPurifier_Token_Start.

Parameters:
$name Tag name
$attr Associative array of attributes
Returns:
Generated HTMLPurifier_Token_Start

Definition at line 41 of file TokenFactory.php.

HTMLPurifier_TokenFactory::createEnd ( name  ) 

Creates a HTMLPurifier_Token_End.

Parameters:
$name Tag name
Returns:
Generated HTMLPurifier_Token_End

Definition at line 52 of file TokenFactory.php.

HTMLPurifier_TokenFactory::createEmpty ( name,
attr = array() 
)

Creates a HTMLPurifier_Token_Empty.

Parameters:
$name Tag name
$attr Associative array of attributes
Returns:
Generated HTMLPurifier_Token_Empty

Definition at line 64 of file TokenFactory.php.

HTMLPurifier_TokenFactory::createText ( data  ) 

Creates a HTMLPurifier_Token_Text.

Parameters:
$data Data of text token
Returns:
Generated HTMLPurifier_Token_Text

Definition at line 75 of file TokenFactory.php.

References $data.

HTMLPurifier_TokenFactory::createComment ( data  ) 

Creates a HTMLPurifier_Token_Comment.

Parameters:
$data Data of comment token
Returns:
Generated HTMLPurifier_Token_Comment

Definition at line 86 of file TokenFactory.php.

References $data.

HTMLPurifier_TokenFactory::createStart ( name,
attr = array() 
)

Creates a HTMLPurifier_Token_Start.

Parameters:
$name Tag name
$attr Associative array of attributes
Returns:
Generated HTMLPurifier_Token_Start

Definition at line 6010 of file HTMLPurifier.standalone.php.

HTMLPurifier_TokenFactory::createEnd ( name  ) 

Creates a HTMLPurifier_Token_End.

Parameters:
$name Tag name
Returns:
Generated HTMLPurifier_Token_End

Definition at line 6021 of file HTMLPurifier.standalone.php.

HTMLPurifier_TokenFactory::createEmpty ( name,
attr = array() 
)

Creates a HTMLPurifier_Token_Empty.

Parameters:
$name Tag name
$attr Associative array of attributes
Returns:
Generated HTMLPurifier_Token_Empty

Definition at line 6033 of file HTMLPurifier.standalone.php.

HTMLPurifier_TokenFactory::createText ( data  ) 

Creates a HTMLPurifier_Token_Text.

Parameters:
$data Data of text token
Returns:
Generated HTMLPurifier_Token_Text

Definition at line 6044 of file HTMLPurifier.standalone.php.

References $data.

HTMLPurifier_TokenFactory::createComment ( data  ) 

Creates a HTMLPurifier_Token_Comment.

Parameters:
$data Data of comment token
Returns:
Generated HTMLPurifier_Token_Comment

Definition at line 6055 of file HTMLPurifier.standalone.php.

References $data.


Member Data Documentation

HTMLPurifier_TokenFactory::$p_start [private]

Prototypes that will be cloned.

Definition at line 22 of file TokenFactory.php.

HTMLPurifier_TokenFactory::$p_end [private]

Definition at line 22 of file TokenFactory.php.

HTMLPurifier_TokenFactory::$p_empty [private]

Definition at line 22 of file TokenFactory.php.

HTMLPurifier_TokenFactory::$p_text [private]

Definition at line 22 of file TokenFactory.php.

HTMLPurifier_TokenFactory::$p_comment [private]

Definition at line 22 of file TokenFactory.php.


The documentation for this class was generated from the following files:
Generated on Thu Jun 19 18:47:32 2008 for HTMLPurifier by  doxygen 1.5.3