public final class RawFunction extends AbstractSyntax implements Named, Refinable
Note that this unit is only broadcasted during the Refine
phase. It is never added to the AST. Subscribe to this type
of unit in order to provide custom functions. If a RawFunction
is not handled by a refiner then a GenericFunctionValue
will be generated instead.
Constructor and Description |
---|
RawFunction(int line,
int column,
String name,
String args)
Creates a new
RawFunction instance. |
Modifier and Type | Method and Description |
---|---|
String |
args()
Gets the function args.
|
RawFunction |
args(String args)
Changes the raw function args.
|
RawFunction |
copy()
For implementations: do not copy comments or orphaned comments, instead be sure to call
AbstractSyntax.copiedFrom(Syntax) on the
new copy. |
boolean |
isRefined()
Gets whether this unit is refined.
|
String |
name()
Gets the function name.
|
RawFunction |
name(String name)
Changes the name of the function.
|
boolean |
shouldBreakBroadcast(SubscriptionPhase phase)
Gets whether an in-progress broadcast should be stopped.
|
void |
write(StyleWriter writer,
StyleAppendable appendable)
Outputs this
Writable 's string representation. |
annotate, annotateUnlessPresent, annotation, annotations, column, comment, comment, comments, comments, comments, copiedFrom, equals, hasAnnotation, hasAnnotation, hashCode, hasSourcePosition, id, isWritable, line, orphanedComments, orphanedComments, orphanedComments, propagateBroadcast, status, status, toString, toString, writesOwnComments, writesOwnOrphanedComments
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
annotate, annotateUnlessPresent, annotation, annotations, column, comment, comment, comments, comments, comments, hasAnnotation, hasAnnotation, hasSourcePosition, id, line, orphanedComments, orphanedComments, orphanedComments, toString, writesOwnComments, writesOwnOrphanedComments
isWritable
propagateBroadcast, status, status
public RawFunction(int line, int column, String name, String args)
RawFunction
instance.line
- The line number.column
- The column number.name
- The function name.args
- The raw function args.public RawFunction name(String name)
name
- The new function name.public String name()
public RawFunction args(String args)
args
- The new function args.public String args()
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 RawFunction copy()
AbstractSyntax
AbstractSyntax.copiedFrom(Syntax)
on the
new copy.copy
in interface Syntax
copy
in class AbstractSyntax
public boolean isRefined()
Refinable
public boolean shouldBreakBroadcast(SubscriptionPhase phase)
Broadcastable
This might be true if a change of state or conditions of the unit result in the broadcast no longer being necessary during
the given SubscriptionPhase
.
shouldBreakBroadcast
in interface Broadcastable
shouldBreakBroadcast
in class AbstractSyntax
phase
- The current SubscriptionPhase
.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.