本文整理了Java中org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping.getNullPolicy()
方法的一些代码示例,展示了XMLCompositeDirectCollectionMapping.getNullPolicy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLCompositeDirectCollectionMapping.getNullPolicy()
方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping
类名称:XMLCompositeDirectCollectionMapping
方法名:getNullPolicy
暂无
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
public boolean isWhitespaceAware() {
return !xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByEmptyNode();
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
public void endElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord) {
XMLField xmlField = (XMLField) xmlCompositeDirectCollectionMapping.getField();
if (!xmlField.getLastXPathFragment().nameIsText()) {
return;
}
Object value = unmarshalRecord.getStringBuffer().toString();
Object collection = unmarshalRecord.getContainerInstance(this);
unmarshalRecord.resetStringBuffer();
if (xmlCompositeDirectCollectionMapping.usesSingleNode()) {
StringTokenizer stringTokenizer = new StringTokenizer((String) value);
while (stringTokenizer.hasMoreTokens()) {
addUnmarshalValue(unmarshalRecord, stringTokenizer.nextToken(), collection);
}
} else {
if (value.equals(XMLConstants.EMPTY_STRING)) {
if (xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByEmptyNode() ||
xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil()) {
return;
}
}
addUnmarshalValue(unmarshalRecord, value, collection);
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
elements.addElement(element);
} else {
if (getNullPolicy() == null) {
elements.addElement(null);
} else {
if (getNullPolicy().getMarshalNullRepresentation() == XMLNullRepresentationType.XSI_NIL) {
elements.addElement(XMLRecord.NIL);
} else if (getNullPolicy().getMarshalNullRepresentation() == XMLNullRepresentationType.ABSENT_NODE) {
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
public boolean startElement(XPathFragment xPathFragment, UnmarshalRecord unmarshalRecord, Attributes atts) {
XMLField xmlField = (XMLField) xmlCompositeDirectCollectionMapping.getField();
if (xmlField.getLastXPathFragment().nameIsText()) {
String type = atts.getValue(XMLConstants.SCHEMA_INSTANCE_URL, XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
if (null != type) {
String namespaceURI = null;
int colonIndex = type.indexOf(XMLConstants.COLON);
if (colonIndex > -1) {
String prefix = type.substring(0, colonIndex);
namespaceURI = unmarshalRecord.resolveNamespacePrefix(prefix);
type = type.substring(colonIndex + 1);
}
unmarshalRecord.setTypeQName(new QName(namespaceURI, type));
}
if (xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil() && xmlCompositeDirectCollectionMapping.getNullPolicy().valueIsNull(atts)) {
getContainerPolicy().addInto(null, unmarshalRecord.getContainerInstance(this), unmarshalRecord.getSession());
}
} else if (xmlField.getLastXPathFragment().isAttribute()) {
if (!this.xmlCompositeDirectCollectionMapping.usesSingleNode()) {
String namespaceURI = xmlField.getLastXPathFragment().getNamespaceURI();
if (namespaceURI == null) {
namespaceURI = XMLConstants.EMPTY_STRING;
}
String value = atts.getValue(namespaceURI, xmlField.getLastXPathFragment().getLocalName());
Object collection = unmarshalRecord.getContainerInstance(this);
addUnmarshalValue(unmarshalRecord, value, collection);
}
}
return true;
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
elements.addElement(element);
} else if(!usesSingleNode()){
AbstractNullPolicy nullPolicy = getNullPolicy();
if (nullPolicy == null) {
elements.addElement(null);
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
elements.addElement(element);
} else if(!usesSingleNode()){
AbstractNullPolicy nullPolicy = getNullPolicy();
if (nullPolicy == null) {
elements.addElement(null);
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
private void addUnmarshalValue(UnmarshalRecord unmarshalRecord, Object value, Object collection) {
if (null == value) {
return;
}
if (xmlCompositeDirectCollectionMapping.getNullPolicy().isNullRepresentedByXsiNil() && xmlCompositeDirectCollectionMapping.getNullPolicy().valueIsNull(unmarshalRecord.getAttributes())) {
return;
}
if ((!isWhitespaceAware() && XMLConstants.EMPTY_STRING.equals(value))) {
return;
}
XMLField xmlField = (XMLField) xmlCompositeDirectCollectionMapping.getField();
XMLConversionManager xmlConversionManager = (XMLConversionManager) unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager();
if (unmarshalRecord.getTypeQName() != null) {
Class typeClass = xmlField.getJavaClass(unmarshalRecord.getTypeQName());
value = xmlConversionManager.convertObject(value, typeClass, unmarshalRecord.getTypeQName());
} else {
value = xmlField.convertValueBasedOnSchemaType(value, xmlConversionManager, unmarshalRecord);
}
if (xmlCompositeDirectCollectionMapping.hasValueConverter()) {
if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) {
value = ((XMLConverter) xmlCompositeDirectCollectionMapping.getValueConverter()).convertDataValueToObjectValue(value, unmarshalRecord.getSession(), unmarshalRecord.getUnmarshaller());
} else {
value = xmlCompositeDirectCollectionMapping.getValueConverter().convertDataValueToObjectValue(value, unmarshalRecord.getSession());
}
}
unmarshalRecord.addAttributeValue(this, value, collection);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
Object fieldValue = domRecord.getValues(this.getField(), this.getNullPolicy());
if (fieldValue == null) {
if (reuseContainer) {
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
Object fieldValue = domRecord.getValues(this.getField(), this.getNullPolicy());
if (fieldValue == null) {
if (reuseContainer) {
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
Object fieldValue = domRecord.getValues(this.getField(), this.getNullPolicy());
if (fieldValue == null) {
if (reuseContainer) {
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
if (xmlCompositeDirectCollectionMapping.getNullPolicy().getMarshalNullRepresentation() != XMLNullRepresentationType.ABSENT_NODE) {
marshalRecord.openStartElement(xPathFragment, namespaceResolver);
XPathFragment nextFragment = xPathFragment.getNextFragment();
xmlCompositeDirectCollectionMapping.getNullPolicy().directMarshal(nextFragment, marshalRecord, object, session, namespaceResolver);
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
if (mapping.getNullPolicy().isNullRepresentedByXsiNil()) {
element.setNillable(true);
内容来源于网络,如有侵权,请联系作者删除!