本文整理了Java中org.dataconservancy.model.dcs.support.Util.isNull()
方法的一些代码示例,展示了Util.isNull()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.isNull()
方法的具体详情如下:
包路径:org.dataconservancy.model.dcs.support.Util
类名称:Util
方法名:isNull
[英]Returns true
if o
is null
.
[中]如果o
为[$2$],则返回true
。
代码示例来源:origin: org.dataconservancy.model/dcs-model
/**
* Throws {@link IllegalArgumentException} if <code>o</code> is <code>null</code>.
*
* @param o an object
* @return the object
*/
static public Object notNull(Object o) {
final String msg = "Object must not be null";
if (Util.isNull(o)) {
throw new IllegalArgumentException(msg);
}
return o;
}
代码示例来源:origin: org.dataconservancy.model/dcs-model
/**
* Returns true if <code>s</code> is empty or <code>null</code>.
*
* @param s a string
* @return true if <code>s</code> is empty or <code>null</code>.
*/
public static boolean isEmptyOrNull(String s) {
return isNull(s) || isEmpty(s);
}
代码示例来源:origin: org.dataconservancy.model/dcs-ui-model-builder-xstream
@Override
public void marshal(Object source,
HierarchicalStreamWriter writer,
MarshallingContext context) {
super.marshal(source, writer, context);
final AdiAjaxTransport adiAjaxTransportSource = (AdiAjaxTransport) source;
if (adiAjaxTransportSource != null) {
writer.startNode("");
if (!isNull(adiAjaxTransportSource.getMessage())) {
writer.startNode("message");
writer.setValue(adiAjaxTransportSource.getMessage());
writer.endNode();
}
List<DataItemTransport> dataItemTransportList = adiAjaxTransportSource.getDataItemTransportList();
if (!isNull(dataItemTransportList) && !dataItemTransportList.isEmpty()) {
((JsonWriter) writer).startNode("dataItemTransportList", dataItemTransportList.getClass());
for (DataItemTransport dataItemTransport: dataItemTransportList) {
context.convertAnother(dataItemTransport);
}
writer.endNode();
}
writer.endNode();
}
}
代码示例来源:origin: org.dataconservancy.dcs/dcs-ui-model-builder-xstream
@Override
public void marshal(Object source,
HierarchicalStreamWriter writer,
MarshallingContext context) {
super.marshal(source, writer, context);
final AdiAjaxTransport adiAjaxTransportSource = (AdiAjaxTransport) source;
if (adiAjaxTransportSource != null) {
writer.startNode("");
if (!isNull(adiAjaxTransportSource.getMessage())) {
writer.startNode("message");
writer.setValue(adiAjaxTransportSource.getMessage());
writer.endNode();
}
List<DataItemTransport> dataItemTransportList = adiAjaxTransportSource.getDataItemTransportList();
if (!isNull(dataItemTransportList) && !dataItemTransportList.isEmpty()) {
((JsonWriter) writer).startNode("dataItemTransportList", dataItemTransportList.getClass());
for (DataItemTransport dataItemTransport: dataItemTransportList) {
context.convertAnother(dataItemTransport);
}
writer.endNode();
}
writer.endNode();
}
}
代码示例来源:origin: org.dataconservancy.dcs/dcs-ui-model-builder-xstream
reader.moveDown();
String value = reader.getValue();
if (!isNull(value) && !value.isEmpty()) {
adiAjaxTransportObject.setMessage(value);
代码示例来源:origin: org.dataconservancy.model/dcs-ui-model-builder-xstream
reader.moveDown();
String value = reader.getValue();
if (!isNull(value) && !value.isEmpty()) {
adiAjaxTransportObject.setMessage(value);
代码示例来源:origin: org.dataconservancy.model/dcs-ui-model-builder-xstream
@Override
public void marshal(Object source,
HierarchicalStreamWriter writer,
MarshallingContext context) {
super.marshal(source, writer, context);
final DataItemTransport dataItemTransportSource = (DataItemTransport) source;
if (dataItemTransportSource != null) {
writer.startNode(E_DATA_ITEM_TRANSPORT);
if (!isNull(dataItemTransportSource.getDataItem())) {
writer.startNode(E_DATA_ITEM);
context.convertAnother(dataItemTransportSource.getDataItem());
writer.endNode();
}
if (!isNull(dataItemTransportSource.getInitialDepositDate())) {
writer.startNode(E_INITIAL_DEPOSIT_DATE);
context.convertAnother(dataItemTransportSource.getInitialDepositDate());
writer.endNode();
}
if (!isNull(dataItemTransportSource.getDepositStatus())) {
writer.startNode(E_DEPOSIT_STATUS);
writer.setValue(dataItemTransportSource.getDepositStatus().toString());
writer.endNode();
}
writer.endNode();
}
}
代码示例来源:origin: org.dataconservancy.dcs/dcs-ui-model-builder-xstream
@Override
public void marshal(Object source,
HierarchicalStreamWriter writer,
MarshallingContext context) {
super.marshal(source, writer, context);
final DataItemTransport dataItemTransportSource = (DataItemTransport) source;
if (dataItemTransportSource != null) {
writer.startNode(E_DATA_ITEM_TRANSPORT);
if (!isNull(dataItemTransportSource.getDataItem())) {
writer.startNode(E_DATA_ITEM);
context.convertAnother(dataItemTransportSource.getDataItem());
writer.endNode();
}
if (!isNull(dataItemTransportSource.getInitialDepositDate())) {
writer.startNode(E_INITIAL_DEPOSIT_DATE);
context.convertAnother(dataItemTransportSource.getInitialDepositDate());
writer.endNode();
}
if (!isNull(dataItemTransportSource.getDepositStatus())) {
writer.startNode(E_DEPOSIT_STATUS);
writer.setValue(dataItemTransportSource.getDepositStatus().toString());
writer.endNode();
}
writer.endNode();
}
}
代码示例来源:origin: org.dataconservancy.model/dcs-model-builder-xstream
if (!isNull(man.getDeliverableUnit())) {
writer.startNode(E_DUNIT);
writer.addAttribute(A_REF, man.getDeliverableUnit());
if (!isNull(techenv)) {
for (String e : techenv) {
if (!isEmptyOrNull(e)) {
if (!isNull(files)) {
for (DcsManifestationFile mf : files) {
writer.startNode(ManifestationFileConverter.E_MANFILE);
if (!isNull(metadataRef)) {
for (DcsMetadataRef md : metadataRef) {
writer.startNode(MetadataConverter.E_METADATA);
if (!isNull(metadata)) {
for (DcsMetadata md : metadata) {
writer.startNode(MetadataConverter.E_METADATA);
代码示例来源:origin: org.dataconservancy.dcs/dcs-model-builder-xstream
if (!isNull(man.getDeliverableUnit())) {
writer.startNode(E_DUNIT);
writer.addAttribute(A_REF, man.getDeliverableUnit());
if (!isNull(techenv)) {
for (String e : techenv) {
if (!isEmptyOrNull(e)) {
if (!isNull(files)) {
for (DcsManifestationFile mf : files) {
writer.startNode(ManifestationFileConverter.E_MANFILE);
if (!isNull(metadataRef)) {
for (DcsMetadataRef md : metadataRef) {
writer.startNode(MetadataConverter.E_METADATA);
if (!isNull(metadata)) {
for (DcsMetadata md : metadata) {
writer.startNode(MetadataConverter.E_METADATA);
代码示例来源:origin: org.dataconservancy.model/dcs-model-builder-xstream
@Override
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
super.marshal(source, writer, context);
final DcsManifestationFile mf = (DcsManifestationFile) source;
if (mf.getRef() != null) {
writer.addAttribute(A_REF, mf.getRef().getRef());
}
if (!isEmptyOrNull(mf.getPath())) {
writer.startNode(E_PATH);
writer.setValue(mf.getPath());
writer.endNode();
}
if (!isNull(mf.getRelSet()) && !mf.getRelSet().isEmpty()) {
for (DcsRelation rel : mf.getRelSet()) {
writer.startNode(E_REL);
context.convertAnother(rel);
writer.endNode();
}
}
}
代码示例来源:origin: org.dataconservancy.dcs/dcs-model-builder-xstream
@Override
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
super.marshal(source, writer, context);
final DcsManifestationFile mf = (DcsManifestationFile) source;
if (mf.getRef() != null) {
writer.addAttribute(A_REF, mf.getRef().getRef());
}
if (!isEmptyOrNull(mf.getPath())) {
writer.startNode(E_PATH);
writer.setValue(mf.getPath());
writer.endNode();
}
if (!isNull(mf.getRelSet()) && !mf.getRelSet().isEmpty()) {
for (DcsRelation rel : mf.getRelSet()) {
writer.startNode(E_REL);
context.convertAnother(rel);
writer.endNode();
}
}
}
代码示例来源:origin: org.dataconservancy.model/dcs-ui-model-builder-xstream
if (!isNull(dataItemSource.getDepositorId())) {
writer.startNode(E_DEPOSITOR);
writer.addAttribute(ATTR_REF, dataItemSource.getDepositorId());
if (!isNull(dataItemSource.getDepositDate())) {
writer.startNode(E_DEPOSIT_DATE);
context.convertAnother(dataItemSource.getDepositDate());
代码示例来源:origin: org.dataconservancy.dcs/dcs-ui-model-builder-xstream
if (!isNull(dataItemSource.getDepositorId())) {
writer.startNode(E_DEPOSITOR);
writer.addAttribute(ATTR_REF, dataItemSource.getDepositorId());
if (!isNull(dataItemSource.getDepositDate())) {
writer.startNode(E_DEPOSIT_DATE);
context.convertAnother(dataItemSource.getDepositDate());
代码示例来源:origin: org.dataconservancy.model/dcs-ui-model-builder-xstream
if (!isNull(dataItemSource.getDepositorId())) {
writer.startNode(E_DEPOSITOR);
writer.addAttribute(ATTR_REF, dataItemSource.getDepositorId());
if (!isNull(dataItemSource.getDepositDate())) {
writer.startNode(E_DEPOSIT_DATE);
context.convertAnother(dataItemSource.getDepositDate());
if (!isNull(dataItemSource.getCreatedDate())) {
writer.startNode(E_CREATE_DATE);
context.convertAnother(dataItemSource.getCreatedDate());
if (!isNull(dataItemSource.getModifiedDate())) {
writer.startNode(E_MODIFIED_DATE);
context.convertAnother(dataItemSource.getModifiedDate());
代码示例来源:origin: org.dataconservancy.dcs/dcs-ui-model-builder-xstream
if (!isNull(dataItemSource.getDepositorId())) {
writer.startNode(E_DEPOSITOR);
writer.addAttribute(ATTR_REF, dataItemSource.getDepositorId());
if (!isNull(dataItemSource.getDepositDate())) {
writer.startNode(E_DEPOSIT_DATE);
context.convertAnother(dataItemSource.getDepositDate());
if (!isNull(dataItemSource.getCreatedDate())) {
writer.startNode(E_CREATE_DATE);
context.convertAnother(dataItemSource.getCreatedDate());
if (!isNull(dataItemSource.getModifiedDate())) {
writer.startNode(E_MODIFIED_DATE);
context.convertAnother(dataItemSource.getModifiedDate());
内容来源于网络,如有侵权,请联系作者删除!