use of php.runtime.reflection.ParameterEntity 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);
}
use of php.runtime.reflection.ParameterEntity in project jphp by jphp-compiler.
the class ParameterDumper method load.
@Override
public ParameterEntity load(InputStream input) throws IOException {
DumpInputStream data = new DumpInputStream(input);
ParameterEntity entity = new ParameterEntity(context);
entity.setType(data.readHintType());
String typeClass = data.readName();
if (typeClass != null && !typeClass.isEmpty()) {
entity.setTypeClass(typeClass);
}
entity.setReference(data.readBoolean());
entity.setMutable(data.readBoolean());
entity.setUsed(data.readBoolean());
entity.setVariadic(data.readBoolean());
entity.setNullable(data.readBoolean());
entity.setName(data.readName());
entity.setTrace(data.readTrace(context));
entity.setDefaultValue(data.readMemory());
entity.setDefaultValueConstName(data.readName());
byte[] raw = data.readRawData();
return entity;
}
Aggregations