@Override public int hashCode() { return Objects.hashCode(super.getHashCode(), getType(), getCollectionType()); }
private void convertPropertyList(Bean source, Map<String, Object> values) { for (SchemaPropertyList prop : source.getSchema().get(SchemaPropertyList.class)) { List<String> vals = source.getValues(prop.getName()); String field = prop.getFieldName(); if (vals == null) { continue; } Collection<Object> c = newCollection(loadClass(prop.getCollectionType())); for (String val : vals) { Object converted = conversion.convert(val, loadClass(prop.getType())); c.add(converted); } values.put(field, c); } }
private static void validatePropertyList(Bean bean) { Schema schema = bean.getSchema(); ClassRepository repos = new ClassRepository(); for (SchemaPropertyList prop : schema.get(SchemaPropertyList.class)) { List<String> values = bean.getValues(prop.getName()); if (values == null) { continue; } for (String value : values) { try { conversion.convert(value, repos.loadClass(prop.getType())); } catch (Exception e) { throw Events.CFG105_WRONG_PROPERTY_TYPE(bean.getId(), prop.getName(), prop.getType(), value); } } } }
private static void validatePropertyList(Bean bean) { Schema schema = bean.getSchema(); for (SchemaPropertyList prop : schema.get(SchemaPropertyList.class)) { List<String> values = bean.getValues(prop.getName()); if (values == null) { continue; } for (String value : values) { try { conversion.convert(value, forName(prop.getType())); } catch (Exception e) { throw Events.CFG105_WRONG_PROPERTY_TYPE(bean.getId(), prop.getName(), prop.getType(), value); } } } }
private void convertPropertyList(Bean source, Map<String, Object> values) { for (SchemaPropertyList prop : source.getSchema().get(SchemaPropertyList.class)) { List<String> vals = source.getValues(prop.getName()); String field = prop.getFieldName(); if (vals == null) { continue; } Collection<Object> c = newCollection(forName(prop.getCollectionType())); for (String val : vals) { Object converted = conversion.convert(val, forName(prop.getType())); c.add(converted); } values.put(field, c); } }
public XmlSchemaCollection(SchemaPropertyList p) { this.name = p.getName(); this.fieldName = p.getFieldName(); this.parameterizedType = p.getType(); this.collectionType = p.getCollectionType(); this.desc = p.getDesc(); this.isImmutable = p.isImmutable(); this.isImmutable = p.isEnum(); this.defaultValues = p.getDefaultValues(); } }