Search in sources :

Example 6 with DumpOutputStream

use of php.runtime.loader.dump.io.DumpOutputStream in project jphp by jphp-compiler.

the class ConstantDumper method save.

@Override
public void save(ConstantEntity entity, OutputStream output) throws IOException {
    DumpOutputStream dump = new DumpOutputStream(output);
    dump.writeBoolean(entity.isCaseSensitise());
    dump.writeEnum(Modifier.PUBLIC);
    dump.writeName(entity.getName());
    dump.writeTrace(debugInformation ? null : entity.getTrace());
    dump.writeMemory(entity.getValue());
    dump.writeRawData(null);
}
Also used : DumpOutputStream(php.runtime.loader.dump.io.DumpOutputStream)

Example 7 with DumpOutputStream

use of php.runtime.loader.dump.io.DumpOutputStream in project jphp by jphp-compiler.

the class FunctionDumper method save.

@Override
public void save(FunctionEntity entity, OutputStream output) throws IOException {
    DumpOutputStream data = new DumpOutputStream(output);
    data.writeBoolean(entity.isStatic());
    // name
    data.writeName(entity.getName());
    data.writeName(entity.getInternalName());
    data.writeBoolean(entity.isReturnReference());
    data.writeBoolean(entity.isUsesStackTrace());
    data.writeBoolean(entity.isImmutable());
    data.writeMemory(entity.getImmutableResult());
    data.writeBoolean(entity.isEmpty());
    // trace
    data.writeTrace(debugInformation ? entity.getTrace() : null);
    data.writeInt(entity.getParameters() == null ? 0 : entity.getParameters().length);
    if (entity.getParameters() != null)
        for (ParameterEntity param : entity.getParameters()) {
            parameterDumper.save(param, output);
        }
    if (includeData) {
        data.writeRawData(entity.getData());
    } else {
        data.writeRawData(null);
    }
    data.writeRawData(null);
}
Also used : ParameterEntity(php.runtime.reflection.ParameterEntity) DumpOutputStream(php.runtime.loader.dump.io.DumpOutputStream)

Example 8 with DumpOutputStream

use of php.runtime.loader.dump.io.DumpOutputStream in project jphp by jphp-compiler.

the class GeneratorDumper method save.

@Override
public void save(GeneratorEntity entity, OutputStream output) throws IOException {
    classDumper.save(entity, output);
    DumpOutputStream printer = new DumpOutputStream(output);
    printer.writeBoolean(entity.isReturnReference());
    printer.writeInt(entity.parameters == null ? 0 : entity.parameters.length);
    if (entity.parameters != null) {
        for (ParameterEntity param : entity.parameters) {
            parameterDumper.save(param, output);
        }
    }
}
Also used : ParameterEntity(php.runtime.reflection.ParameterEntity) DumpOutputStream(php.runtime.loader.dump.io.DumpOutputStream)

Example 9 with DumpOutputStream

use of php.runtime.loader.dump.io.DumpOutputStream in project jphp by jphp-compiler.

the class MethodDumper method save.

@Override
public void save(MethodEntity entity, OutputStream output) throws IOException {
    DumpOutputStream print = new DumpOutputStream(output);
    DocumentComment docComment = entity.getDocComment();
    if (docComment != null) {
        print.writeUTF(docComment.toString());
    } else {
        print.writeUTF("");
    }
    // static
    print.writeBoolean(entity.isStatic());
    // final
    print.writeBoolean(entity.isFinal());
    // abstract
    print.writeBoolean(entity.isAbstract());
    // abstractable
    print.writeBoolean(entity.isAbstractable());
    // immutable
    print.writeBoolean(entity.isImmutable());
    print.writeMemory(entity.getImmutableResult());
    print.writeBoolean(entity.isEmpty());
    // ref
    print.writeBoolean(entity.isReturnReference());
    // uses stack trace
    print.writeBoolean(entity.isUsesStackTrace());
    // modifier
    print.writeEnum(entity.getModifier());
    // name
    print.writeName(entity.getName());
    print.writeName(entity.getInternalName());
    // trace
    print.writeTrace(debugInformation ? entity.getTrace() : null);
    print.writeInt(entity.getParameters() == null ? 0 : entity.getParameters().length);
    if (entity.getParameters() != null)
        for (ParameterEntity param : entity.getParameters()) {
            parameterDumper.save(param, output);
        }
    // raw data
    print.writeRawData(null);
}
Also used : DocumentComment(php.runtime.reflection.DocumentComment) ParameterEntity(php.runtime.reflection.ParameterEntity) DumpOutputStream(php.runtime.loader.dump.io.DumpOutputStream)

Aggregations

DumpOutputStream (php.runtime.loader.dump.io.DumpOutputStream)9 ParameterEntity (php.runtime.reflection.ParameterEntity)4 DumpException (php.runtime.loader.dump.io.DumpException)3 ArrayList (java.util.ArrayList)1 ClassEntity (php.runtime.reflection.ClassEntity)1 ConstantEntity (php.runtime.reflection.ConstantEntity)1 DocumentComment (php.runtime.reflection.DocumentComment)1 FunctionEntity (php.runtime.reflection.FunctionEntity)1 ClosureEntity (php.runtime.reflection.helper.ClosureEntity)1 GeneratorEntity (php.runtime.reflection.helper.GeneratorEntity)1