Example usage for com.facebook.react.bridge WritableArray getString

List of usage examples for com.facebook.react.bridge WritableArray getString

Introduction

In this page you can find the example usage for com.facebook.react.bridge WritableArray getString.

Prototype

@Nullable
    String getString(int index);

Source Link

Usage

From source file:com.horcrux.svg.RenderableShadowNode.java

License:Open Source License

public void mergeProperties(RenderableShadowNode target) {
    WritableArray targetAttributeList = target.getAttributeList();

    if (targetAttributeList == null || targetAttributeList.size() == 0) {
        return;//from  ww w. ja v a 2  s  .  c o m
    }

    mOriginProperties = new ArrayList<>();
    mAttributeList = clonePropList();

    for (int i = 0, size = targetAttributeList.size(); i < size; i++) {
        try {
            String fieldName = targetAttributeList.getString(i);
            Field field = getClass().getField(fieldName);
            Object value = field.get(target);
            mOriginProperties.add(field.get(this));

            if (!hasOwnProperty(fieldName)) {
                mAttributeList.pushString(fieldName);
                field.set(this, value);
            }
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
    }

    mLastMergedList = targetAttributeList;
}