/** * Method for constructing a renamed instance */ public POJOPropertyBuilder withName(String newName) { return new POJOPropertyBuilder(this, newName); }
public boolean anyExplicitNames() { return _anyExplicitNames(_fields) || _anyExplicitNames(_getters) || _anyExplicitNames(_setters) || _anyExplicitNames(_ctorParameters) ; }
public boolean anyDeserializeIgnorals() { return _anyIgnorals(_fields) || _anyIgnorals(_setters) || _anyIgnorals(_ctorParameters) ; }
_properties.clear(); for (POJOPropertyBuilder prop : props) { String name = prop.getName(); if (_forSerialization) { if (prop.hasGetter()) { name = naming.nameForGetterMethod(_config, prop.getGetter(), name); } else if (prop.hasField()) { name = naming.nameForField(_config, prop.getField(), name); if (prop.hasSetter()) { name = naming.nameForSetterMethod(_config, prop.getSetter(), name); } else if (prop.hasConstructorParameter()) { name = naming.nameForConstructorParameter(_config, prop.getConstructorParameter(), name); } else if (prop.hasField()) { name = naming.nameForField(_config, prop.getField(), name); } else if (prop.hasGetter()) { name = naming.nameForGetterMethod(_config, prop.getGetter(), name); if (!name.equals(prop.getName())) { prop = prop.withName(name); _properties.put(name, prop); } else { old.addAll(prop);
Map.Entry<String, POJOPropertyBuilder> entry = it.next(); POJOPropertyBuilder prop = entry.getValue(); String newName = prop.findNewName(); if (newName != null) { if (renamed == null) { renamed = new LinkedList<POJOPropertyBuilder>(); prop = prop.withName(newName); renamed.add(prop); it.remove(); String name = prop.getName(); POJOPropertyBuilder old = _properties.get(name); if (old == null) { _properties.put(name, prop); } else { old.addAll(prop);
private AnnotationMap _mergeAnnotations(int index, Node<? extends AnnotatedMember>... nodes) { AnnotationMap ann = nodes[index].value.getAllAnnotations(); ++index; for (; index < nodes.length; ++index) { if (nodes[index] != null) { return AnnotationMap.merge(ann, _mergeAnnotations(index, nodes)); } } return ann; }
/** * Method called to trim unnecessary entries, such as implicit * getter if there is an explict one available. This is important * for later stages, to avoid unnecessary conflicts. */ public void trimByVisibility() { _fields = _trimByVisibility(_fields); _getters = _trimByVisibility(_getters); _setters = _trimByVisibility(_setters); _ctorParameters = _trimByVisibility(_ctorParameters); }
/** * Method called to remove all entries that are marked as * ignored. */ public void removeIgnored() { _fields = _removeIgnored(_fields); _getters = _removeIgnored(_getters); _setters = _removeIgnored(_setters); _ctorParameters = _removeIgnored(_ctorParameters); }
public boolean anyVisible() { return _anyVisible(_fields) || _anyVisible(_getters) || _anyVisible(_setters) || _anyVisible(_ctorParameters) ; }
public void removeNonVisible() { /* 21-Aug-2011, tatu: This is tricky part -- if and when allow * non-visible property elements to be "pulled in" by visible * counterparts? * For now, we will only do this to pull in setter or field used * as setter, if an explicit getter is found. */ _getters = _removeNonVisible(_getters); _ctorParameters = _removeNonVisible(_ctorParameters); if (_getters == null) { _fields = _removeNonVisible(_fields); _setters = _removeNonVisible(_setters); } }
_properties.clear(); for (POJOPropertyBuilder prop : props) { String name = prop.getName(); if (_forSerialization) { if (prop.hasGetter()) { name = naming.nameForGetterMethod(_config, prop.getGetter(), name); } else if (prop.hasField()) { name = naming.nameForField(_config, prop.getField(), name); if (prop.hasSetter()) { name = naming.nameForSetterMethod(_config, prop.getSetter(), name); } else if (prop.hasConstructorParameter()) { name = naming.nameForConstructorParameter(_config, prop.getConstructorParameter(), name); } else if (prop.hasField()) { name = naming.nameForField(_config, prop.getField(), name); } else if (prop.hasGetter()) { name = naming.nameForGetterMethod(_config, prop.getGetter(), name); if (!name.equals(prop.getName())) { prop = prop.withName(name); _properties.put(name, prop); } else { old.addAll(prop);
Map.Entry<String, POJOPropertyBuilder> entry = it.next(); POJOPropertyBuilder prop = entry.getValue(); String newName = prop.findNewName(); if (newName != null) { if (renamed == null) { renamed = new LinkedList<POJOPropertyBuilder>(); prop = prop.withName(newName); renamed.add(prop); it.remove(); String name = prop.getName(); POJOPropertyBuilder old = _properties.get(name); if (old == null) { _properties.put(name, prop); } else { old.addAll(prop);
@SuppressWarnings("unchecked") public void mergeAnnotations(boolean forSerialization) { if (forSerialization) { if (_getters != null) { AnnotationMap ann = _mergeAnnotations(0, _getters, _fields, _ctorParameters, _setters); _getters = _getters.withValue(_getters.value.withAnnotations(ann)); } else if (_fields != null) { AnnotationMap ann = _mergeAnnotations(0, _fields, _ctorParameters, _setters); _fields = _fields.withValue(_fields.value.withAnnotations(ann)); } } else { if (_ctorParameters != null) { AnnotationMap ann = _mergeAnnotations(0, _ctorParameters, _setters, _fields, _getters); _ctorParameters = _ctorParameters.withValue(_ctorParameters.value.withAnnotations(ann)); } else if (_setters != null) { AnnotationMap ann = _mergeAnnotations(0, _setters, _fields, _getters); _setters = _setters.withValue(_setters.value.withAnnotations(ann)); } else if (_fields != null) { AnnotationMap ann = _mergeAnnotations(0, _fields, _getters); _fields = _fields.withValue(_fields.value.withAnnotations(ann)); } } }
/** * Method called to trim unnecessary entries, such as implicit * getter if there is an explict one available. This is important * for later stages, to avoid unnecessary conflicts. */ public void trimByVisibility() { _fields = _trimByVisibility(_fields); _getters = _trimByVisibility(_getters); _setters = _trimByVisibility(_setters); _ctorParameters = _trimByVisibility(_ctorParameters); }
/** * Method called to remove all entries that are marked as * ignored. */ public void removeIgnored() { _fields = _removeIgnored(_fields); _getters = _removeIgnored(_getters); _setters = _removeIgnored(_setters); _ctorParameters = _removeIgnored(_ctorParameters); }
public boolean anyVisible() { return _anyVisible(_fields) || _anyVisible(_getters) || _anyVisible(_setters) || _anyVisible(_ctorParameters) ; }
public void removeNonVisible() { /* 21-Aug-2011, tatu: This is tricky part -- if and when allow * non-visible property elements to be "pulled in" by visible * counterparts? * For now, we will only do this to pull in setter or field used * as setter, if an explicit getter is found. */ _getters = _removeNonVisible(_getters); _ctorParameters = _removeNonVisible(_ctorParameters); if (_getters == null) { _fields = _removeNonVisible(_fields); _setters = _removeNonVisible(_setters); } }
_properties.clear(); for (POJOPropertyBuilder prop : props) { String name = prop.getName(); if (_forSerialization) { if (prop.hasGetter()) { name = naming.nameForGetterMethod(_config, prop.getGetter(), name); } else if (prop.hasField()) { name = naming.nameForField(_config, prop.getField(), name); if (prop.hasSetter()) { name = naming.nameForSetterMethod(_config, prop.getSetter(), name); } else if (prop.hasConstructorParameter()) { name = naming.nameForConstructorParameter(_config, prop.getConstructorParameter(), name); } else if (prop.hasField()) { name = naming.nameForField(_config, prop.getField(), name); } else if (prop.hasGetter()) { name = naming.nameForGetterMethod(_config, prop.getGetter(), name); if (!name.equals(prop.getName())) { prop = prop.withName(name); _properties.put(name, prop); } else { old.addAll(prop);