Package org.raml.parser.annotation

Examples of org.raml.parser.annotation.Scalar


        final List<Field> declaredFields = ReflectionUtils.getInheritedFields(pojo.getClass());
        pojo.getClass();
        for (Field declaredField : declaredFields)
        {
            declaredField.setAccessible(true);
            Scalar scalar = declaredField.getAnnotation(Scalar.class);
            Mapping mapping = declaredField.getAnnotation(Mapping.class);
            Sequence sequence = declaredField.getAnnotation(Sequence.class);

            if (scalar != null)
            {
View Full Code Here


        }
    }

    private String alias(Field field)
    {
        Scalar scalar = field.getAnnotation(Scalar.class);
        Mapping mapping = field.getAnnotation(Mapping.class);
        Sequence sequence = field.getAnnotation(Sequence.class);

        if (scalar != null && isNotEmpty(scalar.alias()))
        {
            return scalar.alias();
        }
        else if (mapping != null && isNotEmpty(mapping.alias()))
        {
            return mapping.alias();
        }
View Full Code Here

    {
        final List<Field> declaredFields = ReflectionUtils.getInheritedFields(pojoClass);
        final Map<String, TupleRule<?, ?>> innerBuilders = new HashMap<String, TupleRule<?, ?>>();
        for (Field declaredField : declaredFields)
        {
            Scalar scalar = declaredField.getAnnotation(Scalar.class);
            Mapping mapping = declaredField.getAnnotation(Mapping.class);
            Sequence sequence = declaredField.getAnnotation(Sequence.class);
            TupleRule<?, ?> tupleRule = null;
            TupleHandler tupleHandler = null;
            boolean required = false;
            if (scalar != null)
            {
                tupleRule = createScalarRule(declaredField, scalar);
                tupleHandler = createHandler(scalar.handler(), scalar.alias(), ScalarNode.class);
                required = scalar.required();
            }
            else if (mapping != null)
            {
                tupleRule = createMappingRule(declaredField, mapping);
                tupleHandler = createHandler(mapping.handler(), mapping.alias(), MappingNode.class);
View Full Code Here

    protected String unalias(Object pojo, String fieldName)
    {
        List<Field> declaredFields = ReflectionUtils.getInheritedFields(pojo.getClass());
        for (Field declaredField : declaredFields)
        {
            Scalar scalar = declaredField.getAnnotation(Scalar.class);
            Mapping mapping = declaredField.getAnnotation(Mapping.class);
            Sequence sequence = declaredField.getAnnotation(Sequence.class);
            if ((scalar != null && scalar.alias() != null && scalar.alias().equals(fieldName)) ||
                (mapping != null && mapping.alias() != null && mapping.alias().equals(fieldName)) ||
                (sequence != null && sequence.alias() != null && sequence.alias().equals(fieldName)))
            {
                return declaredField.getName();
            }
View Full Code Here

    {
        final List<Field> declaredFields = ReflectionUtils.getInheritedFields(pojoClass);
        final Map<String, TupleBuilder<?, ?>> innerBuilders = new HashMap<String, TupleBuilder<?, ?>>();
        for (Field declaredField : declaredFields)
        {
            Scalar scalar = declaredField.getAnnotation(Scalar.class);
            Mapping mapping = declaredField.getAnnotation(Mapping.class);
            Sequence sequence = declaredField.getAnnotation(Sequence.class);
            TupleBuilder<?, ?> tupleBuilder = null;
            TupleHandler tupleHandler = null;
            if (scalar != null)
            {
                tupleBuilder = createScalarBuilder(declaredField, scalar);
                tupleHandler = createHandler(scalar.handler(), scalar.alias(), ScalarNode.class);

            }
            else if (mapping != null)
            {
                tupleBuilder = createMappingBuilder(declaredField, mapping);
View Full Code Here

TOP

Related Classes of org.raml.parser.annotation.Scalar

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.