public final class Operator extends AbstractGroupable<PropertyValue,PropertyValueMember> implements PropertyValueMember
Constructor and Description |
---|
Operator(int line,
int column,
OperatorType type)
Constructs a new
Operator instance. |
Operator(OperatorType type)
Constructs a new
Operator instance (used for dynamically created Syntax units). |
Modifier and Type | Method and Description |
---|---|
Operator |
copy()
For implementations: do not copy comments or orphaned comments, instead be sure to call
AbstractSyntax.copiedFrom(Syntax) on the
new copy. |
boolean |
isTerm()
Returns true if this member is an instance of
Term . |
boolean |
isWritable()
Returns whether this unit should actually be written.
|
protected Operator |
self()
Should return "this".
|
OperatorType |
type()
Gets the
OperatorType . |
void |
write(StyleWriter writer,
StyleAppendable appendable)
Outputs this
Writable 's string representation. |
append, destroy, group, group, isDestroyed, isFirst, isLast, next, parent, prepend, previous, replaceWith, unlink
annotate, annotateUnlessPresent, annotation, annotations, column, comment, comment, comments, comments, comments, copiedFrom, equals, hasAnnotation, hasAnnotation, hashCode, hasSourcePosition, id, line, orphanedComments, orphanedComments, orphanedComments, propagateBroadcast, shouldBreakBroadcast, status, status, toString, toString, writesOwnComments, writesOwnOrphanedComments
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
append, destroy, group, group, isDestroyed, isFirst, isLast, next, parent, 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
propagateBroadcast, shouldBreakBroadcast, status, status
public Operator(OperatorType type)
Operator
instance (used for dynamically created Syntax
units).
This should be used for dynamically created units.
type
- The type of operator.public Operator(int line, int column, OperatorType type)
Operator
instance.
If dynamically creating a new instance then use Operator(OperatorType)
instead.
line
- The line number.column
- The column number.type
- The type of operator.public OperatorType type()
OperatorType
.OperatorType
.public boolean isTerm()
PropertyValueMember
Term
.isTerm
in interface PropertyValueMember
protected Operator self()
AbstractGroupable
AbstractGroupable
class.self
in class AbstractGroupable<PropertyValue,PropertyValueMember>
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 AbstractGroupable<PropertyValue,PropertyValueMember>
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 Operator copy()
AbstractSyntax
AbstractSyntax.copiedFrom(Syntax)
on the
new copy.copy
in interface PropertyValueMember
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.