Backpage Selma Nc

Backpage Selma Nc



⚑ πŸ‘‰πŸ»πŸ‘‰πŸ»πŸ‘‰πŸ» INFORMATION AVAILABLE CLICK HERE πŸ‘ˆπŸ»πŸ‘ˆπŸ»πŸ‘ˆπŸ»

































Java bean mapping that compiles
Clone, map and transform beans like manual without pain
Mapping is checked at compilation, it is refactoring proof and debuggable
Uses no reflection, no runtime processing, works as fast as manual mapping
Uses only annotations to describe and configure mapping, no external configuration files
Built with JSR 269, supports any Java version from v6, works anywhere (IDE, Maven, Gradle, ...)
Lightweight API, easy to learn, gives rich compiler message with tips for fix
Supports custom mappers, mapping post-processor, custom field to field mapping
Selma is available in maven central, feel free to add it to your pom dependencies.


fr.xebia.extras
selma-processor
1.0
provided




fr.xebia.extras
selma
1.0

Selma uses a mapper interface to describe and configure the needed mapping. Here we want to map Order to OrderDto and reverse.
@Mapper(
withCustomFields = {
@Field({"customer.fullName", "customerFullName"}),
@Field({"reference", "ref"})
},
withIgnoredFields = "id"
)
public interface SelmaMapper {

// This will build a fresh new OrderDto
OrderDto asOrderDto(Order in);

// This will update the given order
Order asOrder(OrderDto in, Order out);

}
Here we defined some configuration for fields:
Field fullName from the Customer class should be mapped to the field customerFullName in OrderDto
Field reference from any class should be mapped to the field ref in any matching class
Field id should be skipped because it does not exist in OrderDto
Once built the generated mapper can be retrieved via Selma class.
// Get SelmaMapper
SelmaMapper mapper = Selma.builder(SelmaMapper.class).build();

// Map my InBean
OrderDto res = mapper.asOrderDto(in);


Compiler will report any issues like not mappable properties, unused mapping configuration or API miss-use.
Check out our sample app project.
Why a 1.0 release now ? Selma now support what I expected in it from the beginning : Custom type to type or field to field and type to type mapping, cyclic mapping, factories, enums, Collections, IoC, Arrays, all kinds of types mapping and so on. The 1.0 release of Selma comes with bug fixes and many new features. Like custom field to field mapping, Maps inheritance, Bean Aggregation and CDI support.
#106: Add support for custom mapping method on per field basis
101: Add support for abstract custom mappers
#100: Add support for aggregated bean mapping
#102: Fix default lower bound type resolution for generic types
#109: Fix custom mapper call with out parameter
#111: Add support for inner mapper interface
#115: Add support for CDI injection
#118: Filter enum private members to avoid
#104: Remove compiler warnings in custom mapper validation
#119: Add support for mapping interfaces instead of beans
#120: Add support for abstract getters and setters in mapped beans
#125: Fix declared bean array mapping
#127: Fix any type to String default mapping
#133: Fix mapping embedded array of prime
#137: Improve CDI support with CDI and CDI_SINGLETON
#138: Add @InheritMaps to avoid @Maps duplication
This release fixes bugs in generic handling and factory methods. It also implement a new cyclic mapping support using an instance cache. Many thanks to all bug reports and pull requests. 1.0 release will be next big release with specific field to field custom mappers. This will be the last release before final 1.0
#2: Support for cyclic mapping with new @Mapper(withCyclicMapping = true) Thanks to Julien Audo
101: Fix generic types resolving in source and destination bean
#81: Make a whole package immutable with new @Mapper(withImmutablesPackages = {"org.project.immutables"}) Thanks to Julien Audo
#90: Automatic conversion of primitives types to String
#80: Add factory support for beans without public constructor Thanks to @facboy
#97: Add support for mapping raw types and improve error handling Thanks to @facboy
#95: Add support for Builder-style setters Thanks to @facboy
#92: Fix using interceptor inside abstract mapper class Thanks to @vakoroteev
#104: Remove compiler warnings in custom mapper validation
#89: Ignore static methods in mapped beans
#101: Fix generic types mapping support
This release introduces factory methods, it is now possible to declare factory beans inside the mapper. Generic type handling has also been improved to support declaring a Mapper generic interface. Many thanks to all bug reports and pull requests. 1.0 release is coming we just cyclic mapping handling and specific field to field custom mappers.
#63: Support for generic type in mappers
#39: Add Factory method and class support
#78: Add WithIoCServiceName to name Spring service using annotation, Thanks to Benoit Charret
#75: Fix generic inherited type handling in collections and map, Thanks to @julaudo
#70: Handle custom mappers in a .class package, Thanks to Antoine Leveugle
#57: Improve error messages for failing custom field to field mapping
This release introduces abstract class mappers, it is now possible to declare custom mappings inside the mapper and call mapping methods from custom mappings. There are also bug fixes. Many thanks to all bug reports and pull requests.
#53: Support for Abstract class mappers to allow custom mapping method to call mapper methods with this.
#65: Fix properties matching to force exact name match instead of startsWith match
#66: Fix temporary variables names on embedded field mapping
#67: Fix custom mapper registry to match properly both update and immutable methods
#68: Fix bad AnnotationMirror cast not valid in eclipse compiler
This release adds support for collection mapping strategy. The mapping strategy allows to choose wether you want to populate collections from getter or not.
@Mapper(withCollectionStrategy = ALLOW_GETTER) // Enable collections mapping from getter

This release adds Spring support using the new withIoc=SPRING. It is also now possible to use a Selma mapper as the custom mapper of another one.
This release deprecates @IgnoreFields and @Fields. The new @Maps annotation should now be used instead. It supports all the parameters available in @Mapper at the method scope.
#35: Deploy snapshots to sonatype snapshot repository
#36: Deprecate @IgnoreFields and @Fields in favor of a new annotation
#37: Add support for update graph in custom mappers
#38: Add support for scoped custom mappers
#40: Add compilation error when default enum value does not exist
#41: Compilation error when fields have no getter
#42: Support scoped mapping interceptor
#43: Remove deprecated @IgnoreFields from warning messages
#44: Add support for qualified class name in custom fields mapping
#45: Add support for custom embedded field to root level field
#46: Add support for ignore missing fields in source bean, destination bean or both
#47: Fix missing custom mapper in type mapping registry
Selma match properties using setter and getter names. Selma can map only same field names. By default, properties not existing in both source and destination beans will break compilation.
You can use Selma to build duplicates of your beans or map from model to DTO when they shares same property names.
public class Person {

private String firstName;
private String lastName;
private Date birthDay;
private int age;
private Long[] indices;
private Collection tags;

// + Getters and Setters
}
@Mapper
public interface PersonMapper {

// Returns a duplicate of the source Person
Person duplicatePerson(Person source);
}
Selma can reduce a model bean to a DTO containing a sublist of the properties.
public class PersonDTO {

private String firstName;
private String lastName;
private Date birthDay;

// + Getters and Setters
}
@Mapper(withIgnoreMissing = IgnoreMissing.DESTINATION)
public interface PersonMapper {

// Returns a new instance of PersonDTO mapped from Person source
PersonDto asPersonDTO(Person source);
}
Here we used IgnoreMissing.DESTINATION to indicate we wish to ignore properties (age, indices, tags) from source bean missing in destination bean. But we could also choose to specify each ignored fields.
@Mapper(withIgnoreFields = {"age", "Person.indices", "fr.xebia.selma.Person.tags"})
public interface PersonMapper {

// Returns a new instance of PersonDTO mapped from Person source
PersonDto asPersonDTO(Person source);
}
Here we used prefixes Person and fr.xebia.selma.Person to show that you can match ignored fields using simple class name or FQCN prefix.
Selma can use a reduced DTO to build a model bean.
@Mapper(withIgnoreMissing = IgnoreMissing.SOURCE)
public interface PersonMapper {

// Returns a new instance of Person mapped from PersonDTO source
Person asPerson(PersonDTO source);
}
Here we used IgnoreMissing.SOURCE to indicate we wish to ignore properties (age, indices, tags) missing in source bean.
A mapper interface can describe multiple mapping methods.
@Mapper
public interface PersonMapper {

// Returns a new instance of PersonDTO mapped from Person source
@Maps(withIgnoreMissing = IgnoreMissing.DESTINATION)
PersonDto asPersonDTO(Person source);

// Returns a new instance of Person mapped from PersonDTO source
@Maps(withIgnoreMissing = IgnoreMissing.SOURCE)
Person asPerson(PersonDTO source);
}
Here we used @Maps annotation to describe mapping per method. Please notice that @Mapper configuration is available for all mapping methods while @Maps is only applied to a single method. Both annotations provides the exact same parameters.
By default Selma checks every single missing properties but you can choose to disable these helpfull checks.
Mapper ignoring all missing properties
@Mapper(withIgnoreMissing = IgnoreMissing.ALL)
public interface PersonMapper {

// Returns a new instance of PersonDTO mapped from Person source
PersonDto asPersonDTO(Person source);

// Returns a new instance of Person mapped from PersonDTO source
Person asPerson(PersonDTO source);
}
Here we used IgnoreMissing.ALL to disable missing properties checking. So we removed @Maps annotation, feel free to combine @Mapper and @Maps in the same mapper.
@Maps configuration inherits and override @Mapper configuration.
Selma takes care of generating mapping for the complete bean graph. Each embedded bean will be mapped in it's own method of the generated code. You can customize the mapping
Person Bean
public class Person {

private String firstName;
private String lastName;
private Date birthDay;
private Address residency;

// + Getters and Setters
}
Address Bean
public class Address {

private String line1;
private String line2;
private String zipCode;
private String city;
private String country;

// + Getters and Setters
}
Mapper declaring nested bean
@Mapper
public interface PersonMapper {

// Returns a new instance of PersonDTO mapped from Person source
PersonDto asPersonDTO(Person source);

// Returns a new instance of AddressDTO mapped from Address source
@Maps(withIgnoreFields = "country")
AddressDTO asAddress(Address source);
}
Here we declared the asAddress(Address source) method in the mapper interface to demonstrate we can do it. asPersonDTO(Person source) implementation will call asAddress(Address source). Note that you do not need to declare this method for the mapping to work.
@Maps annotation can be used to configure the mapping of each nested bean in the graph.
Selma can handle cyclic mapping. This behaviour is disabled by default because it has a small performance impact. You can enable it using the withCyclicMapping parameter available in @Mapper.
Person Bean
public class Person {

private String firstName;
private String lastName;
private Date birthDay;
private Address residency;

// + Getters and Setters
}
Address Bean
public class Address {

private String line1;
private String line2;
private String zipCode;
private String city;
private String country;
private Person person // Cyclic reference here !

// + Getters and Setters
}
Mapper supporting cyclic beans
@Mapper(withCyclicMappings = true)
public interface PersonMapper {

// Returns a new instance of PersonDTO mapped from Person source
PersonDto asPersonDTO(Person source);

}
Here we declared the asPersonDTO(Person source) method in the mapper interface to map Person bean and adress beans. The person bean will be mapped only one time and propagated to the person field of the Address bean.
This feature uses a hashmap to know whether a bean has already been mapped.
You can define custom property to property mapping using withCustomFields parameter available in @Mapper and @Maps.
Person Bean
public class Person {

private String firstName;
private String lastName;
private Date birthDay;

// + Getters and Setters
}
PersonDTO Bean
public class PersonDTO {

private String name;
private String lastName;
private Date birthDate;

// + Getters and Setters
}
Mapper with custom property names
@Mapper(
withCustomFields = {
@Field({"firstName","name"}), @Field({"Person.birthDay","birthDate"})
}
)
public interface PersonMapper {

// Returns a new instance of PersonDTO mapped from Person source
PersonDto asPersonDTO(Person source);

// Returns a new instance of Person mapped from PersonDTO source
Person asPerson(PersonDTO source);
}
This configuration will map firstName to name property and birthDay to birthDate property. The @Field annotation define a route that will be applied from PersonDTO to Person and reverse.
@Field supports prefixes to match fields names using simple class name or FQCN prefix. You can also define custom fields in @Maps annotation.
You can flatten properties from nested bean using withCustomFields parameter available in @Mapper and @Maps.
Person Bean
public class Person {

private String firstName;
private String lastName;
private Date birthDay;

// See Address bean (line1, line2, zipCode, city, country)
private Address address;

// + Getters and Setters
}
PersonDTO Bean
public class PersonDTO {

private String firstName;
private String lastName;
private Date birthDay;
private String addressLine1;
private String addressLine2;
private String addressZipCode;
private String addressCity;
private String addressCountry;

// + Getters and Setters
}
Mapper flattening properties from nested bean
@Mapper(
withCustomFields = {
@Field({"address.line1","addressLine1"}), @Field({"address.line2","addressLine2"}),
@Field({"address.zipCode","addressZipCode"}), @Field({"address.city","addressCity"}),
@Field({"address.country","addressCountry"})
}
)
public interface PersonMapper {

// Returns a new instance of PersonDTO mapped from Person source
PersonDto asPersonDTO(Person source);

// Returns a new instance of Person mapped from PersonDTO source
Person asPerson(PersonDTO source);
}
This configuration will flatten properties from Address bean to address* properties in PersonDTO. It also works to unflatten the properties from PersonDTO to Person and Address.
@Field may flatten from any level of the graph. You are not limited to first nested bean but can point a property from any nesting level.
@Maps annotation is powerfull and can be used multiple times in the same mapper interface. The interface can comes to an end where you define the exact same @Maps for multiple method. To avoid this kind of code duplication @InheritMaps is here to help you. Instead of duplicating the @Maps you can simply use @InheritMaps on the corresponding methods.
Mapper with @InheritMaps
@Mapper
public interface ExtendMapper {


@Maps(withCustomFields = {
@Field({"Proposal.passenger.age", "ProposalDto.passengerAge"}), @Field({"passenger.card", "passengerCard"}),
@Field({"Proposal.passenger.date", "ProposalDto.passengerDate"})
}) ProposalDto asProposalDto(Proposal proposal);

@InheritMaps
Proposal asProposal(ProposalDto proposal);

@InheritMaps
Proposal asProposal(ProposalDto proposal, Proposal out);
}
Mapper with named @InheritMaps
@Mapper
public interface ExtendNamedMapper {


@Maps(withCustomFields = {
@Field({"Proposal.passenger.age", "ProposalDto.passengerAge"}), @Field({"passenger.card", "passengerCard"}),
@Field({"Proposal.passenger.date", "ProposalDto.passengerDate"})
}) ProposalDto asProposalDto(Proposal proposal);

@Maps(withIgnoreFields = {"passengerAge", "passengerDate", "passenger", "passengerCard"})
ProposalDto asReducedProposalDto(Proposal proposal);

@InheritMaps(method = "asReducedProposalDto")
Proposal asProposal(ProposalDto proposal);

@InheritMaps(method = "asReducedProposalDto")
Proposal asProposal(ProposalDto proposal, Proposal out);
}
As you can see, the @InheritMaps inherits its configuration from the @Maps. Selma does its best to identify the good @Maps decorated method to inherit from. By default Selma choose the method with the same in/out types pair.
Sometimes Selma finds multiple eligible methods to inherit from, in such situation you just need to provide the method name to choose in the @InheritMaps parameters.
Instead of creating a new instance of the destination bean, you can choose to map the source bean against a given instance of the destination bean. You only need to declare a second parameter in your mapping methods that will be used as destination instance.
Mapper updating a destination bean
@Mapper
public interface PersonMapper {

// Returns the given destination PersonDto mapped from Person source
PersonDto updatePersonDTOFromPerson(Person source, PersonDto destination);

// Returns the given destination Person mapped from PersonDTO source
Person updatePersonFromPersonDTO(PersonDTO source, Person destination);
}
Selma can map collections using a copy clone strategy. Selma will generate a new collection containing the values mapped from source collection. We support almost all kind of collections and the generated code takes care of preserving the order of elements.
By default Selma uses a setter to populate the newly created collection to the destination bean. When using a Jaxb generated bean you won't have a setter, so you'll need to use the getter to retrieve a fresh new instance of an empty collection to populate with mapped values. For this to work you'll need to use the withCollectionStrategy = ALLOW_GETTER of the @Mapper or @Maps annotation.
Collection bean source
public class CollectionBeanSource {

private List strings;

public CollectionBeanSource(List strings) {
this.strings = strings;
}

public List getStrings() {
if(strings == null){
strings = new ArrayList();
}
return strings;
}
}
Collection bean destination
public class CollectionBeanDestination {

private List strings;

public CollectionBeanDestination() {}

public CollectionBeanDestination(List strings) {
this.strings = strings;
}

public List getStrings() {
if(strings == null){
strings = new ArrayList();
}
return strings;
}

}
Mapper using getter for collection
@Mapper(withCollectionStrategy = ALLOW_GETTER)
public interface CollectionMapper {

CollectionBeanDestination asCollectionBeanDestination(CollectionBeanSource source);

Colle
Home - Town of Selma
Selma v1.0 - Java bean mapping that compiles!
Home - Town of Selma , NC
Selma Real Estate - Selma NC Homes For Sale | Zillow
City Name: SELMA , NC | North Carolina United States ZIP Code 5 Plus 4
Teen Chat For Teens
El Paso Transexual
Miss Charlotte Elise
Backpage Selma Nc

Report Page