Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 1997-2013, www.tinygroup.org (luo_guo@icloud.com). Licensed under the GPL, Version 3.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.gnu.org/licenses/gpl.html 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 org.tinygroup.template.parser;
代码段 Created by luoguo on 2014/6/4.
public class CodeLet {
    private StringBuffer codeBuffer = new StringBuffer();
    public int length(){
        return .length();
    }
    public CodeLet() {
    }
    public CodeLet(String code) {
        .append(code);
    }
    public CodeLet lineCode(String code) {
        return code(code).endLine();
    }
    public CodeLet lineCode(String codeObject... args) {
        return code(codeargs).endLine();
    }
    public static CodeLet codeLet(String codeObject... args) {
        return new CodeLet().code(codeargs);
    }
    public static CodeLet lineCodeLet(String codeObject... args) {
        return new CodeLet().lineCode(codeargs);
    }
    public CodeLet code(String code) {
        .append(code);
        return this;
    }
    public CodeLet codeBefore(String code) {
        .insert(0, code);
        return this;
    }
    public CodeLet code(String codeObject... args) {
        .append(String.format(codeargs));
        return this;
    }
    public StringBuffer getCodeBuffer() {
        return ;
    }
    public String toString() {
        return .toString();
    }
    public CodeLet write(Writer writerthrows IOException {
        writer.write(.toString());
        return this;
    }
    public CodeLet endLine() {
        return code("\r\n");
    }
    public CodeLet code(CodeLet codeLet) {
        return this.code(codeLet.toString());
    }
    public CodeLet lineCode(CodeLet codeLet) {
        return this.lineCode(codeLet.toString());
    }
New to GrepCode? Check out our FAQ X