gpt4 book ai didi

xdi2.core.util.XDIAddressUtil.concatXDIAddresses()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 13:58:40 26 4
gpt4 key购买 nike

本文整理了Java中xdi2.core.util.XDIAddressUtil.concatXDIAddresses()方法的一些代码示例,展示了XDIAddressUtil.concatXDIAddresses()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XDIAddressUtil.concatXDIAddresses()方法的具体详情如下:
包路径:xdi2.core.util.XDIAddressUtil
类名称:XDIAddressUtil
方法名:concatXDIAddresses

XDIAddressUtil.concatXDIAddresses介绍

[英]Concats address(es) and arc(s) into a new address.
[中]将地址和弧合并为新地址。

代码示例

代码示例来源:origin: projectdanube/xdi2

public XDIAddress concatXDIAddress(XDIArc... XDIarc) {
  LinkedList<XDIArc> list = new LinkedList<XDIArc> (Arrays.asList(XDIarc));
  list.addFirst(this);
  return XDIAddressUtil.concatXDIAddresses(list.toArray(new XDIArc[list.size()]));
}

代码示例来源:origin: projectdanube/xdi2

public XDIAddress concatXDIAddress(XDIAddress... XDIaddress) {
  LinkedList<XDIAddress> list = new LinkedList<XDIAddress> (Arrays.asList(XDIaddress));
  list.addFirst(this);
  return XDIAddressUtil.concatXDIAddresses(list.toArray(new XDIArc[list.size()]));
}

代码示例来源:origin: projectdanube/xdi2

/**
 * Returns an XDI address for a JSON data type.
 */
public static XDIAddress dataTypeXDIAddressFromJsonType(String jsonType) {
  XDIAddress jsonTypeXDIAddress = XDIAddress.create("" + XDIConstants.CS_CLASS_RESERVED + jsonType);
  return XDIAddressUtil.concatXDIAddresses(XDI_ADD_DATATYPE_JSON, jsonTypeXDIAddress);
}

代码示例来源:origin: projectdanube/xdi2

/**
 * Returns an XDI address for a MIME data type.
 */
public static XDIAddress dataTypeXDIAddressFromMimeType(String mimeType) {
  XDIAddress mimeTypeXDIAddress = XDIAddress.create("" + XDIConstants.CS_CLASS_RESERVED + mimeType.replace("/", XDIConstants.CS_CLASS_RESERVED.toString()));
  return XDIAddressUtil.concatXDIAddresses(XDI_ADD_DATATYPE_MIME, mimeTypeXDIAddress);
}

代码示例来源:origin: projectdanube/xdi2

/**
 * Concats address(es) and arc(s) into a new address.
 */
public static XDIAddress concatXDIAddresses(final XDIAddress XDIaddress, final XDIArc XDIarc) {
  return concatXDIAddresses(XDIaddress, XDIarc == null ? null : XDIAddress.fromComponent(XDIarc));
}

代码示例来源:origin: projectdanube/xdi2

/**
 * Concats address(es) and arc(s) into a new address.
 */
public static XDIAddress concatXDIAddresses(final XDIArc XDIarc, final XDIAddress XDIaddress) {
  return concatXDIAddresses(XDIarc == null ? null : XDIAddress.fromComponent(XDIarc), XDIaddress);
}

代码示例来源:origin: projectdanube/xdi2

/**
 * Concats address(es) and arc(s) into a new address.
 */
public static XDIAddress concatXDIAddresses(final XDIArc... arcs) {
  XDIAddress[] addresses = new XDIAddress[arcs.length];
  for (int i=0; i<arcs.length; i++) addresses[i] = XDIAddress.fromComponent(arcs[i]);
  return concatXDIAddresses(addresses);
}

代码示例来源:origin: projectdanube/xdi2

/**
 * Returns an XDI address for an XSD data type.
 */
public static XDIAddress dataTypeXDIAddressFromXsdType(String xsdType) {
  XDIAddress xsdTypeXDIAddress = XDIAddress.create("" + XDIConstants.CS_CLASS_RESERVED + xsdType.replace(":", XDIConstants.CS_CLASS_RESERVED.toString()));
  return XDIAddressUtil.concatXDIAddresses(XDI_ADD_DATATYPE_XSD, xsdTypeXDIAddress);
}

代码示例来源:origin: projectdanube/xdi2

public void delNegativePermissionTargetXDIStatement(XDIAddress permissionXDIAddress, XDIStatement targetXDIStatement) {
  this.delPermissionTargetXDIStatement(XDIAddressUtil.concatXDIAddresses(XDILinkContractConstants.XDI_ADD_NOT, permissionXDIAddress), targetXDIStatement);
}

代码示例来源:origin: projectdanube/xdi2

@Override
public XDIAddress relativeToAbsoluteXDIAddress(XDIAddress relativeAddress) {
  XDIAddress absoluteAddress = XDIAddressUtil.concatXDIAddresses(this.getContextNode().getXDIAddress(), relativeAddress);
  if (log.isTraceEnabled()) log.trace("relativeToAbsoluteAddress(" + relativeAddress + " --> " + absoluteAddress + ")");
  return absoluteAddress;
}

代码示例来源:origin: projectdanube/xdi2

public void executeSetOnContextNodeStatement(XDIStatement targetStatement, SetOperation operation, Graph operationResultGraph, ExecutionContext executionContext) throws Xdi2MessagingException {
  XDIAddress targetXDIAddress = XDIAddressUtil.concatXDIAddresses(targetStatement.getTargetXDIAddress());
  this.executeSetOnAddress(targetXDIAddress, operation, operationResultGraph, executionContext);
}

代码示例来源:origin: projectdanube/xdi2

private void initEndpointUris(XdiContext<?> xdiContext, XDIAddress[] endpointUriTypes) throws Xdi2DiscoveryException {
  if (endpointUriTypes == null) return;
  for (XDIAddress endpointUriType : endpointUriTypes) {
    XDIAddress endpointUriXdiAttributeAddress = XDIAddressUtil.concatXDIAddresses(endpointUriType, XDIClientConstants.XDI_ARC_AS_URI);
    XdiAttribute endpointUriXdiAttribute = xdiContext.getXdiAttributeSingleton(endpointUriXdiAttributeAddress, false);
    if (endpointUriXdiAttribute == null) continue;
    endpointUriXdiAttribute = endpointUriXdiAttribute.dereference();
    LiteralNode endpointUriLiteral = endpointUriXdiAttribute.getLiteralNode();
    if (endpointUriLiteral == null) continue;
    String endpointUri = endpointUriLiteral.getLiteralDataString();
    if (endpointUri == null) continue;
    this.endpointUris.put(endpointUriType, URI.create(endpointUri));
  }
}

代码示例来源:origin: projectdanube/xdi2

/**
 * Set the timestamp associated with a context node.
 */
public static void setTimestamp(XdiContext<?> xdiContext, XDIAddress modifierAddress, Date timestamp) {
  XDIAddress timestampXDIAddress = modifierAddress == null ? XDITimestampsConstants.XDI_ADD_AS_T : XDIAddressUtil.concatXDIAddresses(modifierAddress, XDITimestampsConstants.XDI_ARC_AS_T);
  String literalData = timestampToString(timestamp);
  XdiAttributeSingleton xdiAttributeSingleton = xdiContext.getXdiAttributeSingleton(timestampXDIAddress, true);
  xdiAttributeSingleton.setLiteralString(literalData);
}

代码示例来源:origin: projectdanube/xdi2

@Override
  public ContextNode map(JsonElement jsonElement) {
    XDIArc XDIarc = XDIArc.create(((JsonPrimitive) jsonElement).getAsString());
    XDIAddress XDIaddress = XDIAddressUtil.concatXDIAddresses(JSONContextNode.this.getXDIAddress(), XDIarc);
    return new JSONContextNode((JSONGraph) JSONContextNode.this.getGraph(), JSONContextNode.this, XDIarc, XDIaddress);
  }
});

代码示例来源:origin: projectdanube/xdi2

public ContributorResult executeSetOnContextNodeStatement(XDIAddress[] contributorXDIAddresses, XDIAddress contributorsXDIAddress, XDIStatement relativeTargetStatement, SetOperation operation, Graph operationResultGraph, ExecutionContext executionContext) throws Xdi2MessagingException {
  XDIAddress relativeTargetXDIAddress = XDIAddressUtil.concatXDIAddresses(relativeTargetStatement.getContextNodeXDIAddress(), relativeTargetStatement.getContextNodeXDIArc());
  return this.executeSetOnAddress(contributorXDIAddresses, contributorsXDIAddress, relativeTargetXDIAddress, operation, operationResultGraph, executionContext);
}

代码示例来源:origin: projectdanube/xdi2

public ContributorResult executeDelOnContextNodeStatement(XDIAddress[] contributorXDIAddresses, XDIAddress contributorsXDIAddress, XDIStatement relativeTargetStatement, DelOperation operation, Graph operationResultGraph, ExecutionContext executionContext) throws Xdi2MessagingException {
  XDIAddress relativeTargetXDIAddress = XDIAddressUtil.concatXDIAddresses(relativeTargetStatement.getContextNodeXDIAddress(), relativeTargetStatement.getContextNodeXDIArc());
  return this.executeDelOnAddress(contributorXDIAddresses, contributorsXDIAddress, relativeTargetXDIAddress, operation, operationResultGraph, executionContext);
}

代码示例来源:origin: projectdanube/xdi2

public void executeDelOnContextNodeStatement(XDIStatement targetStatement, DelOperation operation, Graph operationResultGraph, ExecutionContext executionContext) throws Xdi2MessagingException {
  XDIAddress targetXDIAddress = XDIAddressUtil.concatXDIAddresses(targetStatement.getContextNodeXDIAddress(), targetStatement.getContextNodeXDIArc());
  this.executeDelOnAddress(targetXDIAddress, operation, operationResultGraph, executionContext);
}

代码示例来源:origin: projectdanube/xdi2

@Override
  public XDIAddress getXDIAddress() {

    if (this.XDIaddress == null) {

      ContextNode contextNode = this.getContextNode();
      
      if (contextNode == null) {

        this.XDIaddress = XDIConstants.XDI_ADD_ROOT;
      } else {

        this.XDIaddress = XDIAddressUtil.concatXDIAddresses(contextNode.getXDIAddress(), this.getXDIArc());
      }
    }

    return this.XDIaddress;
  }
}

代码示例来源:origin: projectdanube/xdi2

/**
 * Get the timestamp associated with a context node.
 */
public static Date getTimestamp(XdiContext<?> xdiContext, XDIAddress modifier) {
  XDIAddress timestampXDIAddress = modifier == null ? XDITimestampsConstants.XDI_ADD_AS_T : XDIAddressUtil.concatXDIAddresses(modifier, XDITimestampsConstants.XDI_ARC_AS_T);
  XdiAttributeSingleton xdiAttributeSingleton = xdiContext.getXdiAttributeSingleton(timestampXDIAddress, false);
  if (xdiAttributeSingleton == null) return null;
  LiteralNode timestampLiteral = xdiAttributeSingleton.getLiteralNode();
  if (timestampLiteral == null) return null;
  Date timestamp = stringToTimestamp(timestampLiteral.getLiteralDataString());
  return timestamp;
}

代码示例来源:origin: projectdanube/xdi2

public XDIAddress getTargetXDIAddress() {
  if (this.isContextNodeStatement()) {
    return XDIAddressUtil.concatXDIAddresses(this.getSubject(), (XDIArc) this.getObject());
  } else if (this.isRelationStatement()) {
    return (XDIAddress) this.getObject();
  }
  return null;
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com