Package com.gwtplatform.idhandler.client

Examples of com.gwtplatform.idhandler.client.WithElementId


        stubPassingField(ownerTypeParentFieldTypeSubField2, mock(JClassType.class),
                "ownerTypeParentFieldTypeSubField2");
    }

    void stubPassingField(JField field, JClassType fieldType, String fieldName) {
        WithElementId idAnnotation = mock(WithElementId.class);
        when(field.isPrivate()).thenReturn(false);
        when(field.isStatic()).thenReturn(false);
        when(field.getType()).thenReturn(fieldType);
        when(field.getName()).thenReturn(fieldName);
        when(fieldType.isClass()).thenReturn(fieldType);
        when(field.getAnnotation(WithElementId.class)).thenReturn(idAnnotation);
        when(idAnnotation.value()).thenReturn("");
        when(idAnnotation.processType()).thenReturn(true);
    }
View Full Code Here


        assertThat(tested.statements.size(), is(equalTo(expected.size())));
        assertThat(tested.statements.containsAll(expected), is(equalTo(true)));
    }

    void stubFieldIdAnnotation(JField field, String fieldId, boolean processType) {
        WithElementId idAnnotation = mock(WithElementId.class);
        when(field.getAnnotation(WithElementId.class)).thenReturn(idAnnotation);
        when(idAnnotation.value()).thenReturn(fieldId);
        when(idAnnotation.processType()).thenReturn(processType);
    }
View Full Code Here

                    die(String.format("Field %s of type %s is already present on path from the owner type %s: %s",
                            fieldName, fieldType.getQualifiedSourceName(), ownerType.getQualifiedSourceName(),
                            grandParents.toString()));
                }

                WithElementId idAnnotation = field.getAnnotation(WithElementId.class);
                String fieldId = idAnnotation.value();
                if ("".equals(fieldId)) {
                    fieldId = fieldName;
                }

                String elementId = idPrefix + ID_ELEMENT_SEPARATOR + fieldId;
                String fieldExpression = ElementIdHandlerGenerator.ElementIdHandler_generateAndSetIds_owner
                        + parentFieldExpression + fieldName;
                ElementIdStatement statement = new ElementIdStatement(fieldExpression, elementId);

                if (statements.contains(statement)) {
                    die(String.format("Duplicate element ID %s for field %s of type %s",
                            elementId, fieldName, fieldType.getQualifiedSourceName()));
                }

                statements.add(statement);

                if (idAnnotation.processType()) {
                    List<JClassType> newGrandParents = new ArrayList<JClassType>(grandParents);
                    newGrandParents.add(fieldType);

                    doParse(fieldType, newGrandParents, parentFieldExpression + fieldName + ".", elementId);
                }
View Full Code Here

TOP

Related Classes of com.gwtplatform.idhandler.client.WithElementId

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.