PHP Class PhpCss\Ast\Visitor\Xpath

Inheritance: extends Overload
Datei anzeigen Open project: ThomasWeinert/PhpCss

Public Methods

Method Description
__construct ( integer $options, string $defaultPrefix = self::DEFAULT_NAMESPACE_PREFIX ) Create visitor and store mode options
__toString ( ) Return the collected selector string
clear ( ) Clear the visitor object to visit another selector group
hasOption ( $option ) : integer Read the status of an option
setOptions ( integer $options, string $defaultPrefix = self::DEFAULT_NAMESPACE_PREFIX ) Validate and store the options.
visitEnterSelectorSequence ( Sequence $sequence ) : boolean If here is already data in the buffer, add a separator before starting the next.
visitEnterSelectorSequenceGroup ( Group $group ) : boolean Validate the buffer before visiting a Ast\Selector\Group.
visitEnterSelectorSimplePseudoClass ( PseudoClass $pseudoClass )
visitLeaveSelectorSequence ( ) : boolean If the visitor is in the condition status, close it.
visitLeaveSelectorSimplePseudoClass ( )
visitSelectorCombinatorChild ( )
visitSelectorCombinatorDescendant ( )
visitSelectorCombinatorFollower ( )
visitSelectorCombinatorNext ( )
visitSelectorSimpleAttribute ( PhpCss\Ast\Selector\Simple\Attribute $attribute )
visitSelectorSimpleClassName ( ClassName $class ) : boolean Output the class selector to the buffer
visitSelectorSimpleId ( Id $id ) : boolean Output the class selector to the buffer
visitSelectorSimplePseudoClass ( PseudoClass $pseudoClass )
visitSelectorSimplePseudoClassLanguage ( Language $language )
visitSelectorSimplePseudoClassPosition ( Position $position )
visitSelectorSimplePseudoElement ( PseudoElement $pseudoElement )
visitSelectorSimpleType ( Type $type ) : boolean Output the type (element name) selector to the buffer
visitSelectorSimpleUniversal ( Universal $universal ) : boolean Output the universal type (* or xmlns|*) selector to the buffer

Private Methods

Method Description
add ( string $string ) Add a string to the buffer
addCondition ( $condition ) prepare buffer to add a condition to the xpath expression
endConditions ( ) end condition if in condition status
quoteLiteral ( string $literal ) : string Quote literal if needed
setElement ( $element )
status ( null | integer $status = NULL ) : integer Get/Set the current visiting status
strtolower ( $string ) : string Use unicode aware strtolower if available

Method Details

__construct() public method

Create visitor and store mode options
public __construct ( integer $options, string $defaultPrefix = self::DEFAULT_NAMESPACE_PREFIX )
$options integer
$defaultPrefix string

__toString() public method

Return the collected selector string
public __toString ( )

clear() public method

Clear the visitor object to visit another selector group
public clear ( )

hasOption() public method

Read the status of an option
public hasOption ( $option ) : integer
$option
return integer

setOptions() public method

Validate and store the options.
public setOptions ( integer $options, string $defaultPrefix = self::DEFAULT_NAMESPACE_PREFIX )
$options integer
$defaultPrefix string

visitEnterSelectorSequence() public method

If here is already data in the buffer, add a separator before starting the next.
public visitEnterSelectorSequence ( Sequence $sequence ) : boolean
$sequence PhpCss\Ast\Selector\Sequence
return boolean

visitEnterSelectorSequenceGroup() public method

If the buffer already contains data, throw an exception.
public visitEnterSelectorSequenceGroup ( Group $group ) : boolean
$group PhpCss\Ast\Selector\Group
return boolean

visitEnterSelectorSimplePseudoClass() public method

public visitEnterSelectorSimplePseudoClass ( PseudoClass $pseudoClass )
$pseudoClass PhpCss\Ast\Selector\Simple\PseudoClass

visitLeaveSelectorSequence() public method

If the visitor is in the condition status, close it.

visitLeaveSelectorSimplePseudoClass() public method

visitSelectorCombinatorChild() public method

visitSelectorCombinatorDescendant() public method

visitSelectorCombinatorFollower() public method

visitSelectorCombinatorNext() public method

visitSelectorSimpleAttribute() public method

public visitSelectorSimpleAttribute ( PhpCss\Ast\Selector\Simple\Attribute $attribute )
$attribute PhpCss\Ast\Selector\Simple\Attribute

visitSelectorSimpleClassName() public method

Output the class selector to the buffer
public visitSelectorSimpleClassName ( ClassName $class ) : boolean
$class PhpCss\Ast\Selector\Simple\ClassName
return boolean

visitSelectorSimpleId() public method

Output the class selector to the buffer
public visitSelectorSimpleId ( Id $id ) : boolean
$id PhpCss\Ast\Selector\Simple\Id
return boolean

visitSelectorSimplePseudoClass() public method

public visitSelectorSimplePseudoClass ( PseudoClass $pseudoClass )
$pseudoClass PhpCss\Ast\Selector\Simple\PseudoClass

visitSelectorSimplePseudoClassLanguage() public method

public visitSelectorSimplePseudoClassLanguage ( Language $language )
$language PhpCss\Ast\Selector\Simple\PseudoClass\Language

visitSelectorSimplePseudoClassPosition() public method

public visitSelectorSimplePseudoClassPosition ( Position $position )
$position PhpCss\Ast\Selector\Simple\PseudoClass\Position

visitSelectorSimplePseudoElement() public method

public visitSelectorSimplePseudoElement ( PseudoElement $pseudoElement )
$pseudoElement PhpCss\Ast\Selector\Simple\PseudoElement

visitSelectorSimpleType() public method

Output the type (element name) selector to the buffer
public visitSelectorSimpleType ( Type $type ) : boolean
$type PhpCss\Ast\Selector\Simple\Type
return boolean

visitSelectorSimpleUniversal() public method

Output the universal type (* or xmlns|*) selector to the buffer
public visitSelectorSimpleUniversal ( Universal $universal ) : boolean
$universal PhpCss\Ast\Selector\Simple\Universal
return boolean