com.squarespace.less.NodeBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of less-core Show documentation
Show all versions of less-core Show documentation
Less compiler in Java, based on less.js
/**
* Copyright (c) 2014 SQUARESPACE, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.squarespace.less;
import com.squarespace.less.model.Block;
import com.squarespace.less.model.BlockDirective;
import com.squarespace.less.model.Comment;
import com.squarespace.less.model.Definition;
import com.squarespace.less.model.Directive;
import com.squarespace.less.model.Features;
import com.squarespace.less.model.Guard;
import com.squarespace.less.model.Media;
import com.squarespace.less.model.Mixin;
import com.squarespace.less.model.MixinCall;
import com.squarespace.less.model.MixinCallArgs;
import com.squarespace.less.model.MixinParams;
import com.squarespace.less.model.Node;
import com.squarespace.less.model.Operation;
import com.squarespace.less.model.Operator;
import com.squarespace.less.model.Parameter;
import com.squarespace.less.model.Rule;
import com.squarespace.less.model.Ruleset;
import com.squarespace.less.model.Selector;
import com.squarespace.less.model.Selectors;
import com.squarespace.less.model.Stylesheet;
import com.squarespace.less.model.Variable;
import com.squarespace.less.parse.LessStream;
/**
* Allows clients to substitute custom implementations of nodes constructed
* by {@link LessStream#parse}.
*
* For example, when the parser needs to construct a Comment, it will
* call {@link #buildComment}.
*/
public interface NodeBuilder {
BlockDirective buildBlockDirective(String name, Block block);
Comment buildComment(String body, boolean block);
Comment buildComment(String body, boolean block, boolean newline);
Definition buildDefinition(String name, Node value);
Definition buildDefinition(String name, Node value, boolean important);
Directive buildDirective(String name, Node value);
Media buildMedia(Features features, Block block);
Mixin buildMixin(String name, MixinParams params, Guard guard);
Mixin buildMixin(String name, MixinParams params, Guard guard, Block block);
MixinCall buildMixinCall(Selector selector, MixinCallArgs args, boolean important);
Operation buildOperation(Operator operator, Node operand0, Node operand1);
Parameter buildParameter(String name);
Parameter buildParameter(String name, Node value);
Parameter buildParameter(String name, boolean variadic);
Rule buildRule(Node property, Node value);
Rule buildRule(Node property, Node value, boolean important);
Ruleset buildRuleset(Selectors group, Block block);
Selector buildSelector();
Stylesheet buildStylesheet(Block block);
Variable buildVariable(String name);
Variable buildVariable(String name, boolean curly);
Variable buildVariable(String name, boolean curly, boolean ruleset);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy