public final class FontFaceBlock extends AbstractAtRuleMember implements AtRuleBlock
FontDescriptor
,
FontFacePlugin
Constructor and Description |
---|
FontFaceBlock()
Creates a new instance with no line or number specified (used for dynamically created
Syntax units). |
FontFaceBlock(int line,
int column)
Constructs a new
FontFaceBlock instance. |
Modifier and Type | Method and Description |
---|---|
FontFaceBlock |
copy()
For implementations: do not copy comments or orphaned comments, instead be sure to call
AbstractSyntax.copiedFrom(Syntax) on the
new copy. |
SyntaxCollection<FontFaceBlock,FontDescriptor> |
fontDescriptors()
Gets the
SyntaxCollection of FontDescriptor s within this unit. |
boolean |
isWritable()
Returns whether this unit should actually be written.
|
Iterator<Statement> |
iterator() |
void |
propagateBroadcast(Broadcaster broadcaster,
Status status)
Broadcasts or rebroadcasts all child units using the given
Broadcaster . |
SyntaxCollection<StatementIterable,Statement> |
statements()
Gets the
SyntaxCollection of statements within this unit. |
void |
write(StyleWriter writer,
StyleAppendable appendable)
Outputs this
Writable 's string representation. |
boolean |
writesOwnOrphanedComments()
Specifies whether this object will handle writing its own orphaned comments, instead of the automatic behavior of the
StyleWriter . |
parent, parent
annotate, annotateUnlessPresent, annotation, annotations, column, comment, comment, comments, comments, comments, copiedFrom, equals, hasAnnotation, hasAnnotation, hashCode, hasSourcePosition, id, line, orphanedComments, orphanedComments, orphanedComments, shouldBreakBroadcast, status, status, toString, toString, writesOwnComments
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
parent, parent
annotate, annotateUnlessPresent, annotation, annotations, column, comment, comment, comments, comments, comments, hasAnnotation, hasAnnotation, hasSourcePosition, id, line, orphanedComments, orphanedComments, orphanedComments, toString, writesOwnComments
shouldBreakBroadcast, status, status
public FontFaceBlock()
Syntax
units).public FontFaceBlock(int line, int column)
FontFaceBlock
instance.line
- The line number.column
- The column number.public SyntaxCollection<FontFaceBlock,FontDescriptor> fontDescriptors()
SyntaxCollection
of FontDescriptor
s within this unit.public SyntaxCollection<StatementIterable,Statement> statements()
StatementIterable
SyntaxCollection
of statements within this unit.statements
in interface StatementIterable
public void propagateBroadcast(Broadcaster broadcaster, Status status)
Broadcastable
Broadcaster
.
The broadcast will only occur for a unit if its Status
matches the given Status
.
Implementers should call this on child units and SyntaxCollection
s first, then use the broadcaster to broadcast
itself. All of this should be wrapped in a check to ensure the Status
matches.
propagateBroadcast
in interface StatementIterable
propagateBroadcast
in interface Broadcastable
propagateBroadcast
in class AbstractSyntax
broadcaster
- Use this Broadcaster
to broadcast all unbroadcasted child units.status
- Broadcast units that have this status.public boolean isWritable()
Writable
Usually this should just return true, however some units that are detachable or otherwise potentially invalid should first check their state and respond appropriately.
isWritable
in interface Writable
isWritable
in class AbstractSyntax
public boolean writesOwnOrphanedComments()
Syntax
StyleWriter
.
If returning true, be sure to check StyleWriter#shouldWriteAllComments()
to determine if comments should actually
be written out or not. The StyleWriter#appendComments(Iterable, StyleAppendable)
utility method contains this logic
and is the preferable way to handle it.
writesOwnOrphanedComments
in interface Syntax
writesOwnOrphanedComments
in class AbstractSyntax
public void write(StyleWriter writer, StyleAppendable appendable) throws IOException
Writable
Writable
's string representation.
Important notes for implementation:
Do not use the StyleWriter
in an attempt to write direct content (Strings, chars, etc...). Use the StyleAppendable
.
The StyleWriter
should be used to make decisions based on writer settings (e.g., compressed vs. verbose output
mode), as well as for writing inner or child Writable
s. Do not call the this method method directly on inner
or child Writable
s! That would bypass any overrides that are set on the StyleWriter
. Use StyleWriter.writeInner(Writable, StyleAppendable)
instead.
write
in interface Writable
writer
- Writer to use for output settings and for writing inner Writable
s.appendable
- Append direct content to this StyleAppendable
.IOException
- If an I/O error occurs.public FontFaceBlock copy()
AbstractSyntax
AbstractSyntax.copiedFrom(Syntax)
on the
new copy.copy
in interface AtRuleBlock
copy
in interface Syntax
copy
in class AbstractSyntax
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.