List of usage examples for javax.xml.bind.annotation.adapters NormalizedStringAdapter unmarshal
public String unmarshal(String text)
From source file:org.kuali.rice.kim.api.jaxb.PermissionDetailListAdapter.java
/** * @see javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object) *///w w w. jav a2s . com @Override public Map<String, String> unmarshal(PermissionDetailList v) throws Exception { if (v != null) { NormalizedStringAdapter normalizedStringAdapter = new NormalizedStringAdapter(); Map<String, String> map = new HashMap<String, String>(); for (MapStringStringAdapter.StringMapEntry stringMapEntry : v.getPermissionDetails()) { String tempKey = normalizedStringAdapter.unmarshal(stringMapEntry.getKey()); if (StringUtils.isBlank(tempKey)) { throw new UnmarshalException("Cannot create a permission detail entry with a blank key"); } else if (map.containsKey(tempKey)) { throw new UnmarshalException( "Cannot create more than one permission detail entry with a key of \"" + tempKey + "\""); } map.put(tempKey, normalizedStringAdapter.unmarshal(stringMapEntry.getValue())); } } return null; }
From source file:org.kuali.rice.kim.api.jaxb.QualificationListAdapter.java
/** * @see javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object) *///from ww w .j a v a 2 s . com @Override public Map<String, String> unmarshal(QualificationList v) throws Exception { if (v != null) { NormalizedStringAdapter normalizedStringAdapter = new NormalizedStringAdapter(); Map<String, String> map = new HashMap<String, String>(); for (MapStringStringAdapter.StringMapEntry stringMapEntry : v.getQualifications()) { String tempKey = normalizedStringAdapter.unmarshal(stringMapEntry.getKey()); if (StringUtils.isBlank(tempKey)) { throw new UnmarshalException("Cannot create a qualification entry with a blank key"); } else if (map.containsKey(tempKey)) { throw new UnmarshalException( "Cannot create more than one qualification entry with a key of \"" + tempKey + "\""); } map.put(tempKey, normalizedStringAdapter.unmarshal(stringMapEntry.getValue())); } } return null; }