org.eclipse.persistence.internal.helper.Helper.replaceFirstSubString()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(91)

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

Helper.replaceFirstSubString介绍

[英]Replaces the first subString of the source with the replacement.
[中]将源的第一个子字符串替换为替换字符串。

代码示例

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

/**
 * ADVANCED:
 * Allow user to replace the $PORT subString of the local host URL with the user user input at runtime.
 * In this case, user can call this API to specify the port number for a specific transport during pre-login session event or before session login.
 * Example:
 * If input is 7799, the local host URL of ormi://145.23.127.79:$PORT/app_name will become ormi://145.23.127.79:7799/app_name
 */
public void replaceTransportPortNumber(String portNumber) {
  String newURL = Helper.replaceFirstSubString(this.getUrl(), ServiceId.PORT_TOKEN, portNumber);
  if (newURL != null) {
    this.setUrl(newURL);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * ADVANCED:
 * Allow user to replace the $PORT subString of the local host URL with the user user input at runtime.
 * In this case, user can call this API to specify the port number for a specific transport during pre-login session event or before session login.
 * Example:
 * If input is 7799, the local host URL of ormi://145.23.127.79:$PORT/app_name will become ormi://145.23.127.79:7799/app_name
 */
public void replaceTransportPortNumber(String portNumber) {
  String newURL = Helper.replaceFirstSubString(this.getUrl(), ServiceId.PORT_TOKEN, portNumber);
  if (newURL != null) {
    this.setUrl(newURL);
  }
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * ADVANCED:
 * Allow user to replace the $PORT subString of the local host URL with the user user input at runtime.
 * In this case, user can call this API to specify the port number for a specific transport during pre-login session event or before session login.
 * Example:
 * If input is 7799, the local host URL of ormi://145.23.127.79:$PORT/app_name will become ormi://145.23.127.79:7799/app_name
 */
public void replaceTransportPortNumber(String portNumber) {
  String newURL = Helper.replaceFirstSubString(this.getUrl(), ServiceId.PORT_TOKEN, portNumber);
  if (newURL != null) {
    this.setUrl(newURL);
  }
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * ADVANCED:
 * Allow user to replace the $HOST subString of the local host URL with the user user input at runtime.
 * By default, EclipseLink will try to discovery the local host IP and may fail due to security or network restrictions.
 * In this case, user can call this API to specify the IP address or host name during pre-login session event or before session login.
 * Example:
 * If input is 145.23.127.79, the local host URL of ormi://$HOST:2971:/app_name will become ormi://145.23.127.79:2971:/app_name
 */
public void replaceLocalHostIPAddress(String ipAddress) {
  String newURL = Helper.replaceFirstSubString(this.getUrl(), ServiceId.HOST_TOKEN, ipAddress);
  if (newURL != null) {
    this.setUrl(newURL);
  }
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

/**
 * ADVANCED:
 * Allow user to replace the $HOST subString of the local host URL with the user user input at runtime.
 * By default, EclipseLink will try to discovery the local host IP and may fail due to security or network restrictions.
 * In this case, user can call this API to specify the IP address or host name during pre-login session event or before session login.
 * Example:
 * If input is 145.23.127.79, the local host URL of ormi://$HOST:2971:/app_name will become ormi://145.23.127.79:2971:/app_name
 */
public void replaceLocalHostIPAddress(String ipAddress) {
  String newURL = Helper.replaceFirstSubString(this.getUrl(), ServiceId.HOST_TOKEN, ipAddress);
  if (newURL != null) {
    this.setUrl(newURL);
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * ADVANCED:
 * Allow user to replace the $HOST subString of the local host URL with the user user input at runtime.
 * By default, EclipseLink will try to discovery the local host IP and may fail due to security or network restrictions.
 * In this case, user can call this API to specify the IP address or host name during pre-login session event or before session login.
 * Example:
 * If input is 145.23.127.79, the local host URL of ormi://$HOST:2971:/app_name will become ormi://145.23.127.79:2971:/app_name
 */
public void replaceLocalHostIPAddress(String ipAddress) {
  String newURL = Helper.replaceFirstSubString(this.getUrl(), ServiceId.HOST_TOKEN, ipAddress);
  if (newURL != null) {
    this.setUrl(newURL);
  }
}

相关文章

Helper类方法