Package org.auraframework.instance

Examples of org.auraframework.instance.InstanceStack$Entry


    @Override
    public ComponentConfig provide() throws QuickFixException {
        AuraContext context = Aura.getContextService().getCurrentContext();
        BaseComponent<?, ?> component = context.getCurrentComponent();
        InstanceStack iStack = context.getInstanceStack();
        ComponentConfig cc = new ComponentConfig();
        List<Component> components = new ArrayList<Component>();
        Map<String, Object> m = Maps.newHashMapWithExpectedSize(1);
        m.put("body", components);
        cc.setAttributes(m);

        AttributeSet atts = component.getAttributes();
        m.put("template", atts.getValue("body"));
        Object o = atts.getValue("isTrue");
        Boolean isTrue = (Boolean) o;
        ComponentDefRefArrayImpl facet;
        // get body facet if true, else facet if false
        if (isTrue != null && isTrue.booleanValue()) {
            facet = (ComponentDefRefArrayImpl) atts.getValue("body");
        } else {
            facet = (ComponentDefRefArrayImpl) atts.getValue("else");
        }
        if (facet != null) {
            iStack.setAttributeName("body");
            components.addAll(facet.newInstance(atts.getValueProvider()));
            iStack.clearAttributeName("body");
        }
        return cc;
    }
View Full Code Here


    private final AttributeSet attributeSet;
    private final String path;

    public EventImpl(DefDescriptor<EventDef> eventDefDescriptor, Map<String, Object> attributes,
            BaseComponent<?, ?> valueProvider) throws QuickFixException {
      InstanceStack iStack = Aura.getContextService().getCurrentContext().getInstanceStack();
      iStack.pushInstance(this, eventDefDescriptor);
        this.path = iStack.getPath();
        this.eventDefDescriptor = eventDefDescriptor;
        this.attributeSet = new AttributeSetImpl(eventDefDescriptor, valueProvider, this);
        this.attributeSet.set(attributes);
        iStack.popInstance(this);
    }
View Full Code Here

    private final JavascriptModelDef modelDef;
    private final String path;

    public JavascriptModel(JavascriptModelDef modelDef) {
        this.modelDef = modelDef;
        InstanceStack iStack = Aura.getContextService().getCurrentContext().getInstanceStack();
        iStack.pushInstance(this, modelDef.getDescriptor());
        iStack.setAttributeName("m");
        this.path = iStack.getPath();
        for (JavascriptValueDef member : this.modelDef.getAllMembers()) {
            bean.put(member.getName(), clone(member.getDefaultValue()));
        }
        iStack.clearAttributeName("m");
        iStack.popInstance(this);
    }
View Full Code Here

    public InstanceStack getInstanceStack() {
        if (currentAction != null) {
            return currentAction.getInstanceStack();
        } else {
            if (fakeInstanceStack == null) {
                fakeInstanceStack = new InstanceStack();
            }
            return fakeInstanceStack;
        }
    }
View Full Code Here

        }
    };

    @Override
    public void registerComponent(BaseComponent<?, ?> component) {
        InstanceStack iStack = getInstanceStack();
        if (iStack.isUnprivileged()) {
            if (componentCount++ > MAX_COMPONENT_COUNT) {
                //
                // This is bad, try to give the poor user an idea of what happened.
                //
                Action tmp = getCurrentAction();
                StringBuffer sb = new StringBuffer();
                if (tmp != null) {
                    sb.append(tmp);
                    sb.append("(");
                    tmp.logParams(new SBKeyValueLogger(sb));
                    sb.append(")");
                } else {
                    sb.append("request");
                }
                throw new SystemErrorException("Too many components for "+sb.toString());
            }
        }
        iStack.registerComponent(component);
    }
View Full Code Here

    @Override
    public DefDescriptor<?> getCurrentDescriptor() {
        DefDescriptor<?> caller = getCurrentCallingDescriptor();
        if (caller == null) {
            InstanceStack istack = getInstanceStack();
            Instance<?> instance = istack.peek();
            if (instance != null) {
                caller = instance.getDescriptor();
            }
        }
View Full Code Here

        return caller;
    }

    @Override
    public List<String> createComponentStack() {
        InstanceStack istack = getInstanceStack();
        List<String> info = null;
        if (istack != null) {
            info = istack.getStackInfo();
            if (info.size() == 0) {
                info = null;
            }
        }
        return info;
View Full Code Here

                    for (TestMethod testMethod : inputTestData.getTestMethod()) {
                        List<TestRecord> originalTestRecords = testMethod.getTestRecord();
                        for (TestRecord originalTestRecord : originalTestRecords) {
                            if (originalTestRecord.getId().equals(testRecord.get(RECORD_POSITION))) {
                                OutputData outputData = new OutputData();
                                Entry outputEntry = new Entry();
                                outputEntry.setKey(ACTUAL_RESULT);
                                outputEntry.setValue(testRecord.get(ACTUAL_RESULT).toString());
                                outputData.getEntry().add(outputEntry);
                                originalTestRecord.setOutputData(outputData);
                                outputDataAdded = true;
                                break;
                            }
View Full Code Here

                    for (TestMethod testMethod : inputTestData.getTestMethod()) {
                        List<TestRecord> originalTestRecords = testMethod.getTestRecord();
                        for (TestRecord originalTestRecord : originalTestRecords) {
                            if (originalTestRecord.getId().equals(testRecord.get(RECORD_POSITION))) {
                                OutputData outputData = new OutputData();
                                Entry outputEntry = new Entry();
                                outputEntry.setKey(ACTUAL_RESULT);
                                outputEntry.setValue(testRecord.get(ACTUAL_RESULT).toString());
                                Entry durationEntry = new Entry();
                                durationEntry.setKey(DURATION);
                                durationEntry.setValue(testRecord.get(DURATION).toString());
                                outputData.getEntry().add(outputEntry);
                                outputData.getEntry().add(durationEntry);
                                if(testRecord.get(TEST_STATUS) != null){
                                    Entry statusEntry = new Entry();
                                    statusEntry.setKey(TEST_STATUS);
                                    statusEntry.setValue(testRecord.get(TEST_STATUS).toString());
                                    outputData.getEntry().add(statusEntry);
                                }
                               
                               
                                originalTestRecord.setOutputData(outputData);
                                outputDataAdded = true;
                                break;
                            }
                        }
                        if (outputDataAdded) {
                            break;
                        }
                    }
                }else{
                    //Method did not return any data. So only write the duration as output
                    for (TestMethod testMethod : inputTestData.getTestMethod()) {
                        List<TestRecord> originalTestRecords = testMethod.getTestRecord();
                        for (TestRecord originalTestRecord : originalTestRecords) {
                            if (originalTestRecord.getId().equals(testRecord.get(RECORD_POSITION))) {
                                OutputData outputData = new OutputData();
                                Entry durationEntry = new Entry();
                                durationEntry.setKey(DURATION);
                                durationEntry.setValue(testRecord.get(DURATION).toString());
                                outputData.getEntry().add(durationEntry);
                                originalTestRecord.setOutputData(outputData);
                                outputDataAdded = true;
                                break;
                            }
View Full Code Here

TOP

Related Classes of org.auraframework.instance.InstanceStack$Entry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.