Search in sources :

Example 1 with Signature

use of php.runtime.annotation.Reflection.Signature in project jphp by jphp-compiler.

the class ReflectionFunctionAbstract method getNumberOfRequiredParameters.

@Signature
public Memory getNumberOfRequiredParameters(Environment env, Memory... args) {
    int cnt = 0;
    ParameterEntity[] parameterEntities = getClosureEntity() == null ? getEntity().getParameters() : getClosureEntity().parameters;
    for (ParameterEntity e : parameterEntities) {
        if (e.getDefaultValue() == null)
            cnt++;
    }
    return LongMemory.valueOf(cnt);
}
Also used : ParameterEntity(php.runtime.reflection.ParameterEntity) Signature(php.runtime.annotation.Reflection.Signature)

Example 2 with Signature

use of php.runtime.annotation.Reflection.Signature in project jphp by jphp-compiler.

the class BaseBaseException method getTraceAsString.

@Signature
public Memory getTraceAsString(Environment env, Memory... args) {
    int i = 0;
    StringBuilder sb = new StringBuilder();
    if (callStack != null) {
        for (CallStackItem e : getCallStack()) {
            if (i != 0)
                sb.append("\n");
            sb.append("#").append(i).append(" ").append(e.toString(false));
            i++;
        }
        if (i != 0)
            sb.append("\n");
        sb.append("#").append(i).append(" {main}");
    }
    return new StringMemory(sb.toString());
}
Also used : CallStackItem(php.runtime.env.CallStackItem) StringMemory(php.runtime.memory.StringMemory) Signature(php.runtime.annotation.Reflection.Signature)

Example 3 with Signature

use of php.runtime.annotation.Reflection.Signature in project jphp by jphp-compiler.

the class WrapImageView method __construct.

@Override
@Signature
public void __construct(WrapActivity activity) {
    __wrappedObject = new ImageView(activity);
    __wrappedObject.setId(idCounter.getAndIncrement());
}
Also used : ImageView(android.widget.ImageView) Signature(php.runtime.annotation.Reflection.Signature)

Example 4 with Signature

use of php.runtime.annotation.Reflection.Signature in project jphp by jphp-compiler.

the class WrapImageView method setImageAsset.

@Signature
public void setImageAsset(String fileName) throws IOException {
    InputStream inputStream = AndroidStandaloneLoader.getContext().getAssets().open(fileName);
    getWrappedObject().setImageDrawable(Drawable.createFromStream(inputStream, fileName));
}
Also used : InputStream(java.io.InputStream) Signature(php.runtime.annotation.Reflection.Signature)

Example 5 with Signature

use of php.runtime.annotation.Reflection.Signature in project jphp by jphp-compiler.

the class WrapTextView method __construct.

@Signature
public void __construct(WrapActivity activity) {
    __wrappedObject = new TextView(activity);
    __wrappedObject.setId(idCounter.getAndIncrement());
}
Also used : TextView(android.widget.TextView) Signature(php.runtime.annotation.Reflection.Signature)

Aggregations

Signature (php.runtime.annotation.Reflection.Signature)30 ArrayMemory (php.runtime.memory.ArrayMemory)8 InputStream (java.io.InputStream)4 Memory (php.runtime.Memory)4 ForeachIterator (php.runtime.lang.ForeachIterator)4 StringMemory (php.runtime.memory.StringMemory)4 ZipEntry (java.util.zip.ZipEntry)2 DOMSource (javax.xml.transform.dom.DOMSource)2 StreamResult (javax.xml.transform.stream.StreamResult)2 Stream (php.runtime.ext.core.classes.stream.Stream)2 WrapTime (php.runtime.ext.core.classes.time.WrapTime)2 LongMemory (php.runtime.memory.LongMemory)2 Intent (android.content.Intent)1 Button (android.widget.Button)1 EditText (android.widget.EditText)1 ImageView (android.widget.ImageView)1 LinearLayout (android.widget.LinearLayout)1 TextView (android.widget.TextView)1 HikariConfig (com.zaxxer.hikari.HikariConfig)1 HikariDataSource (com.zaxxer.hikari.HikariDataSource)1