public interface SelectorPart extends Groupable<Selector,SelectorPart>
Modifier and Type | Method and Description |
---|---|
SelectorPart |
copy()
Performs a deep copy of the instance.
|
Selector |
parent()
Gets the parent
Selector instance. |
SelectorPartType |
type()
Gets the
SelectorPartType of this SelectorPart . |
append, destroy, group, group, isDestroyed, isFirst, isLast, next, prepend, previous, replaceWith, unlink
annotate, annotateUnlessPresent, annotation, annotations, column, comment, comment, comments, comments, comments, hasAnnotation, hasAnnotation, hasSourcePosition, id, line, orphanedComments, orphanedComments, orphanedComments, toString, writesOwnComments, writesOwnOrphanedComments
isWritable, write
propagateBroadcast, shouldBreakBroadcast, status, status
Selector parent()
Selector
instance.
Take this CSS snippet for example:
.class > .class2 #id, p a
There are two Selector
s, The first being .class > .class2 #id
, the second being p a
.
For the SelectorPart
#id
, which is an IdSelector
, calling this method will return the first Selector
(with .class > .class2 #id
).
parent
in interface Groupable<Selector,SelectorPart>
SelectorPartType type()
SelectorPartType
.SelectorPart copy()
Syntax
This includes any inner syntax units, for example the selectors inside of a rule. This also carries over the comments and orphaned comments.
Keep in mind that copying is generally not preferred. Particularly, it is generally better to parse the source again than
to copy a Stylesheet
. Copying a specific syntax unit may be appropriate when duplicating the terms in a declaration
or the selector parts in a selector.
Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE file in the repository.