ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
TokenFactory.php
Go to the documentation of this file.
1 <?php
2 
15 {
16  // p stands for prototype
17 
21  private $p_start;
22 
26  private $p_end;
27 
31  private $p_empty;
32 
36  private $p_text;
37 
41  private $p_comment;
42 
46  public function __construct()
47  {
48  $this->p_start = new HTMLPurifier_Token_Start('', array());
49  $this->p_end = new HTMLPurifier_Token_End('');
50  $this->p_empty = new HTMLPurifier_Token_Empty('', array());
51  $this->p_text = new HTMLPurifier_Token_Text('');
52  $this->p_comment = new HTMLPurifier_Token_Comment('');
53  }
54 
61  public function createStart($name, $attr = array())
62  {
63  $p = clone $this->p_start;
64  $p->__construct($name, $attr);
65  return $p;
66  }
67 
73  public function createEnd($name)
74  {
75  $p = clone $this->p_end;
76  $p->__construct($name);
77  return $p;
78  }
79 
86  public function createEmpty($name, $attr = array())
87  {
88  $p = clone $this->p_empty;
89  $p->__construct($name, $attr);
90  return $p;
91  }
92 
98  public function createText($data)
99  {
100  $p = clone $this->p_text;
101  $p->__construct($data);
102  return $p;
103  }
104 
110  public function createComment($data)
111  {
112  $p = clone $this->p_comment;
113  $p->__construct($data);
114  return $p;
115  }
116 }
117 
118 // vim: et sw=4 sts=4
createComment($data)
Creates a HTMLPurifier_Token_Comment.
Concrete end token class.
Definition: End.php:10
createEnd($name)
Creates a HTMLPurifier_Token_End.
$p_comment
HTMLPurifier_Token_Comment
Concrete start token class.
Definition: Start.php:6
$p_end
HTMLPurifier_Token_End
Factory for token generation.
createText($data)
Creates a HTMLPurifier_Token_Text.
$p_empty
HTMLPurifier_Token_Empty
__construct()
Generates blank prototypes for cloning.
$p_text
HTMLPurifier_Token_Text
$p_start
HTMLPurifier_Token_Start
Create styles array
The data for the language used.
Concrete empty token class.
Definition: Empty.php:6
createEmpty($name, $attr=array())
Creates a HTMLPurifier_Token_Empty.
Concrete text token class.
Definition: Text.php:12
Concrete comment token class.
Definition: Comment.php:6
createStart($name, $attr=array())
Creates a HTMLPurifier_Token_Start.