Examples of NestedProperty


Examples of ma.glasnost.orika.metadata.NestedProperty

   
  @Test
  public void testNestedProperty() {
    String np = "start.x";

    NestedProperty p = (NestedProperty) propertyResolver.getProperty(Line.class, np);
    Assert.assertEquals(Integer.TYPE, p.getRawType());
    p = (NestedProperty) propertyResolver.getProperty(Student.class, "favoriteBook.author.name");
 
    Assert.assertEquals(String.class, p.getRawType());
  }
View Full Code Here

Examples of ma.glasnost.orika.metadata.NestedProperty

                path.add(new VariableRef(propPath[0], name));
                String[] expr = property.getExpression().split("\\.");
                for (int i = 1; i < propPath.length; ++i) {
                    Property[] nestedPath = new Property[i];
                    System.arraycopy(propPath, 0, nestedPath, 0, i);
                    path.add(new VariableRef(new NestedProperty(join(expr, ".", 0, i + 1), propPath[i], nestedPath), name));
                }
            } else {
                path = Collections.singletonList(new VariableRef(propPath[0], name));
            }
            return path;
View Full Code Here

Examples of ma.glasnost.orika.metadata.NestedProperty

       
        if (property == null) {
            throw new RuntimeException(typeName + " does not contain property [" + p + "]");
        }
       
        return new NestedProperty(expression.toString(), property, path.toArray(new Property[path.size()]));
    }
View Full Code Here

Examples of ma.glasnost.orika.metadata.NestedProperty

        } else {
            throw new IllegalArgumentException("'" + p + "' is not a valid element property for " + type);
        }
       
        if (!"".equals(owningProperty.getName())) {
            elementProperty = new NestedProperty(p, elementProperty, new Property[]{owningProperty});
        }
        return elementProperty;
       
    }
View Full Code Here

Examples of ma.glasnost.orika.metadata.NestedProperty

  @Test
  public void testNestedProperty() {
    String np = "start.x";
    PropertyResolverStrategy propertyResolver = UtilityResolver.getDefaultPropertyResolverStrategy();
    NestedProperty p = propertyResolver.getNestedProperty(Line.class, np);

    Assert.assertEquals(Integer.TYPE, p.getRawType());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.