本文整理汇总了Java中javax.xml.bind.annotation.adapters.NormalizedStringAdapter类的典型用法代码示例。如果您正苦于以下问题:Java NormalizedStringAdapter类的具体用法?Java NormalizedStringAdapter怎么用?Java NormalizedStringAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NormalizedStringAdapter类属于javax.xml.bind.annotation.adapters包,在下文中一共展示了NormalizedStringAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unmarshal
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* @see javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
*/
@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;
}
示例2: unmarshal
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* @see javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
*/
@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;
}
示例3: unmarshal
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* @see javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
*/
@Override
public NameAndNamespacePair unmarshal(NameAndNamespacePair v) throws Exception {
if (v != null) {
if (StringUtils.isBlank(v.getName())) {
throw new UnmarshalException("Cannot import a name-and-namespace pair with a blank name");
} else if (StringUtils.isBlank(v.getNamespaceCode())) {
throw new UnmarshalException("Cannot import a name-and-namespace pair with a blank namespace code");
} if (CoreServiceApiServiceLocator.getNamespaceService().getNamespace(v.getNamespaceCode()) == null) {
throw new UnmarshalException("Cannot import a name-and-namespace pair with invalid or unknown namespace \"" +
v.getNamespaceCode() + "\"");
}
v.setName(new NormalizedStringAdapter().unmarshal(v.getName()));
v.setNamespaceCode(v.getNamespaceCode());
}
return v;
}
示例4: marshal
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* @see javax.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object)
*/
@Override
public NameAndNamespacePair marshal(NameAndNamespacePair v) throws Exception {
if (v != null) {
if (StringUtils.isBlank(v.getName())) {
throw new MarshalException("Cannot export a name-and-namespace pair with a blank name");
} else if (StringUtils.isBlank(v.getNamespaceCode())) {
throw new MarshalException("Cannot export a name-and-namespace pair with a blank namespace code");
} else if (CoreServiceApiServiceLocator.getNamespaceService().getNamespace(v.getNamespaceCode()) == null) {
throw new MarshalException("Cannot export a name-and-namespace pair with invalid or unknown namespace \"" + v.getNamespaceCode() + "\"");
}
v.setName(new NormalizedStringAdapter().marshal(v.getName()));
v.setNamespaceCode(v.getNamespaceCode());
}
return v;
}
示例5: unmarshal
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* @see javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
*/
@Override
public String unmarshal(NameAndNamespacePair v) throws Exception {
if (v != null) {
Template permissionTemplate = KimApiServiceLocator.getPermissionService().findPermTemplateByNamespaceCodeAndName(
v.getNamespaceCode(), new NormalizedStringAdapter().unmarshal(v.getName()));
if (permissionTemplate == null) {
throw new UnmarshalException("Cannot find permission template with namespace \"" + v.getNamespaceCode() + "\" and name \"" + v.getName() + "\"");
}
return permissionTemplate.getId();
}
return null;
}
示例6: unmarshal
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* @see javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
*/
@Override
public String unmarshal(NameAndNamespacePair v) throws Exception {
if (v != null) {
KimTypeContract kimType = KimApiServiceLocator.getKimTypeInfoService().findKimTypeByNameAndNamespace(
v.getNamespaceCode(), new NormalizedStringAdapter().unmarshal(v.getName()));
if (kimType == null) {
throw new UnmarshalException("Cannot find KIM Type with namespace \"" + v.getNamespaceCode() + "\" and name \"" + v.getName() + "\"");
}
return kimType.getId();
}
return null;
}
示例7: createRefAgentInstanceID
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0", name = "refAgentInstanceID")
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
public JAXBElement<String> createRefAgentInstanceID(String value) {
return new JAXBElement<String>(_RefAgentInstanceID_QNAME, String.class, null, value);
}
示例8: createLanguage
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0", name = "language")
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
public JAXBElement<String> createLanguage(String value) {
return new JAXBElement<String>(_Language_QNAME, String.class, null, value);
}
示例9: createImsxSendingAgentIdentifier
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0", name = "imsx_sendingAgentIdentifier")
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
public JAXBElement<String> createImsxSendingAgentIdentifier(String value) {
return new JAXBElement<String>(_ImsxSendingAgentIdentifier_QNAME, String.class, null, value);
}
示例10: createSourcedId
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0", name = "sourcedId")
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
public JAXBElement<String> createSourcedId(String value) {
return new JAXBElement<String>(_SourcedId_QNAME, String.class, null, value);
}
示例11: testEquals
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
public void testEquals() throws Exception {
final CAdapter adapter = new CAdapter(NormalizedStringAdapter.class,
false);
final CAdapter adapter1 = new CAdapter(NormalizedStringAdapter.class,
false);
final TypeUse left = CBuiltinLeafInfo.NORMALIZED_STRING;
final TypeUse right = TypeUseFactory.adapt(CBuiltinLeafInfo.STRING,
adapter);
// Assert.assertTrue(adapter.equals(adapter1));
// Assert.assertTrue(left.equals(right));
// Assert.assertTrue(left.hashCode() == right.hashCode());
}
示例12: createShipOption
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
@XmlElementDecl(namespace = "", name = "ShipOption")
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
public JAXBElement<String> createShipOption(String value) {
return new JAXBElement<String>(_ShipOption_QNAME, String.class, null, value);
}
示例13: createFulfillmentCenterID
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
@XmlElementDecl(namespace = "", name = "FulfillmentCenterID")
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
public JAXBElement<String> createFulfillmentCenterID(String value) {
return new JAXBElement<String>(_FulfillmentCenterID_QNAME, String.class, null, value);
}
示例14: createShipmentID
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
@XmlElementDecl(namespace = "", name = "ShipmentID")
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
public JAXBElement<String> createShipmentID(String value) {
return new JAXBElement<String>(_ShipmentID_QNAME, String.class, null, value);
}
示例15: createExternalCustomerID
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; //导入依赖的package包/类
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
@XmlElementDecl(namespace = "", name = "ExternalCustomerID")
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
public JAXBElement<String> createExternalCustomerID(String value) {
return new JAXBElement<String>(_ExternalCustomerID_QNAME, String.class, null, value);
}