Examples of JacksonMetadata


Examples of org.springframework.data.rest.webmvc.json.JacksonMetadata

  private List<Descriptor> createJacksonDescriptor(String name, Class<?> type) {

    List<Descriptor> descriptors = new ArrayList<Descriptor>();

    for (BeanPropertyDefinition definition : new JacksonMetadata(mapper, type)) {

      AnnotatedMethod getter = definition.getGetter();
      Description description = getter.getAnnotation(Description.class);
      ResourceDescription fallback = SimpleResourceDescription.defaultFor(String.format("%s.%s", name,
          definition.getName()));
View Full Code Here

Examples of org.springframework.data.rest.webmvc.json.JacksonMetadata

  private List<Descriptor> buildPropertyDescriptors(Class<?> type, final String baseRel) {

    PersistentEntity<?, ?> entity = persistentEntities.getPersistentEntity(type);
    final List<Descriptor> propertyDescriptors = new ArrayList<Descriptor>();
    final JacksonMetadata jackson = new JacksonMetadata(mapper, type);
    final PropertyMappings propertyMappings = new PropertyMappings(mappings);
    final AssociationLinks associationLinks = new AssociationLinks(mappings);

    entity.doWithProperties(new SimplePropertyHandler() {

      @Override
      public void doWithPersistentProperty(PersistentProperty<?> property) {

        BeanPropertyDefinition propertyDefinition = jackson.getDefinitionFor(property);
        ResourceMapping propertyMapping = propertyMappings.getMappingFor(property);

        if (propertyDefinition != null) {
          propertyDescriptors.add(//
              descriptor(). //
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.