Package com.asakusafw.runtime.model

Examples of com.asakusafw.runtime.model.PropertyOrder


                continue;
            }
            results.put(property, method);
        }

        PropertyOrder annotation = modelClass.getAnnotation(PropertyOrder.class);
        if (annotation == null) {
            LOG.info("Annotation {} is not defined in {}",
                    PropertyOrder.class.getSimpleName(),
                    modelClass.getName());
            return results;
        }
        Map<PropertyName, Method> ordered = new LinkedHashMap<PropertyName, Method>();
        for (String name : annotation.value()) {
            String[] words = name.split("(_|-)+");
            PropertyName propertyName = PropertyName.newInstance(words);
            Method method = results.remove(propertyName);
            if (method == null) {
                LOG.warn("Property {} is not found in {}", name, modelClass.getName());
View Full Code Here


     */
    @Test
    public void single_property() throws Exception {
        ModelLoader loader = generate();
        Class<?> modelClass = loader.modelType("Model");
        PropertyOrder annotation = modelClass.getAnnotation(PropertyOrder.class);
        assertThat(annotation, is(notNullValue()));
        assertThat(annotation.value(), is(new String[] { "property" }));
    }
View Full Code Here

     */
    @Test
    public void many_properties() throws Exception {
        ModelLoader loader = generate();
        Class<?> modelClass = loader.modelType("Model");
        PropertyOrder annotation = modelClass.getAnnotation(PropertyOrder.class);
        assertThat(annotation, is(notNullValue()));
        assertThat(annotation.value(), is(new String[] {
                "first",
                "second_property",
                "a",
                "last",
        }));
View Full Code Here

TOP

Related Classes of com.asakusafw.runtime.model.PropertyOrder

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.