public final class MediaQueryExpression extends AbstractGroupable<MediaQuery,MediaQueryExpression>
In the following example:
@
media all and (min-width: 800px) { ... }
The expression is (min-width: 800px)
MediaQueryExpressionParser
Constructor and Description |
---|
MediaQueryExpression(int line,
int column,
String feature)
Creates a new
MediaQueryExpression instance. |
MediaQueryExpression(String feature)
Creates a new
MediaQueryExpression instance. |
Modifier and Type | Method and Description |
---|---|
MediaQueryExpression |
copy()
For implementations: do not copy comments or orphaned comments, instead be sure to call
AbstractSyntax.copiedFrom(Syntax) on the
new copy. |
String |
feature()
Gets the media feature name.
|
MediaQueryExpression |
feature(String feature)
Sets the media feature name.
|
protected MediaQueryExpression |
self()
Should return "this".
|
List<PropertyValueMember> |
terms()
Gets the list of terms and operators.
|
MediaQueryExpression |
terms(Iterable<PropertyValueMember> terms)
Sets the terms and operators in this
MediaQueryExpression . |
void |
write(StyleWriter writer,
StyleAppendable appendable)
Outputs this
Writable 's string representation. |
append, destroy, group, group, isDestroyed, isFirst, isLast, isWritable, 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
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 MediaQueryExpression(String feature)
MediaQueryExpression
instance.
This should be used for dynamically created declarations.
feature
- The media feature name, e.g., "min-width".public MediaQueryExpression(int line, int column, String feature)
MediaQueryExpression
instance.line
- The line number.column
- The column number.feature
- The media feature name, e.g., "min-width".public MediaQueryExpression terms(Iterable<PropertyValueMember> terms)
MediaQueryExpression
.terms
- The list of terms and operators.public List<PropertyValueMember> terms()
public MediaQueryExpression feature(String feature)
feature
- The media feature, e.g., "min-width".public String feature()
protected MediaQueryExpression self()
AbstractGroupable
AbstractGroupable
class.self
in class AbstractGroupable<MediaQuery,MediaQueryExpression>
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.
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 MediaQueryExpression copy()
AbstractSyntax
AbstractSyntax.copiedFrom(Syntax)
on the
new copy.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.