org.apache.xml.utils.URI.isWellFormedAddress()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(128)

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

URI.isWellFormedAddress介绍

[英]Determine whether a string is syntactically capable of representing a valid IPv4 address or the domain name of a network host. A valid IPv4 address consists of four decimal digit groups separated by a '.'. A hostname consists of domain labels (each of which must begin and end with an alphanumeric but may contain '-') separated & by a '.'. See RFC 2396 Section 3.2.2.
[中]确定字符串在语法上是否能够表示有效的IPv4地址或网络主机的域名。有效的IPv4地址由四个以“.”分隔的十进制数字组组成。主机名由域标签组成(每个域标签必须以字母数字开头和结尾,但可能包含“-”)并用“.”分隔。参见RFC 2396第3.2.2节。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Set the host for this URI. If null is passed in, the userinfo
 * field is also set to null and the port is set to -1.
 *
 * @param p_host the host for this URI
 *
 * @throws MalformedURIException if p_host is not a valid IP
 *                                  address or DNS hostname.
 */
public void setHost(String p_host) throws MalformedURIException
{
 if (p_host == null || p_host.trim().length() == 0)
 {
  m_host = p_host;
  m_userinfo = null;
  m_port = -1;
 }
 else if (!isWellFormedAddress(p_host))
 {
  throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
 }
 m_host = p_host;
}

代码示例来源:origin: xalan/xalan

/**
 * Set the host for this URI. If null is passed in, the userinfo
 * field is also set to null and the port is set to -1.
 *
 * @param p_host the host for this URI
 *
 * @throws MalformedURIException if p_host is not a valid IP
 *                                  address or DNS hostname.
 */
public void setHost(String p_host) throws MalformedURIException
{
 if (p_host == null || p_host.trim().length() == 0)
 {
  m_host = p_host;
  m_userinfo = null;
  m_port = -1;
 }
 else if (!isWellFormedAddress(p_host))
 {
  throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
 }
 m_host = p_host;
}

代码示例来源:origin: org.apache.xalan/com.springsource.org.apache.xalan

/**
 * Set the host for this URI. If null is passed in, the userinfo
 * field is also set to null and the port is set to -1.
 *
 * @param p_host the host for this URI
 *
 * @throws MalformedURIException if p_host is not a valid IP
 *                                  address or DNS hostname.
 */
public void setHost(String p_host) throws MalformedURIException
{
 if (p_host == null || p_host.trim().length() == 0)
 {
  m_host = p_host;
  m_userinfo = null;
  m_port = -1;
 }
 else if (!isWellFormedAddress(p_host))
 {
  throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
 }
 m_host = p_host;
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Set the host for this URI. If null is passed in, the userinfo
 * field is also set to null and the port is set to -1.
 *
 * @param p_host the host for this URI
 *
 * @throws MalformedURIException if p_host is not a valid IP
 *                                  address or DNS hostname.
 */
public void setHost(String p_host) throws MalformedURIException
{
 if (p_host == null || p_host.trim().length() == 0)
 {
  m_host = p_host;
  m_userinfo = null;
  m_port = -1;
 }
 else if (!isWellFormedAddress(p_host))
 {
  throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
 }
 m_host = p_host;
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Set the host for this URI. If null is passed in, the userinfo
 * field is also set to null and the port is set to -1.
 *
 * @param p_host the host for this URI
 *
 * @throws MalformedURIException if p_host is not a valid IP
 *                                  address or DNS hostname.
 */
public void setHost(String p_host) throws MalformedURIException
{
 if (p_host == null || p_host.trim().length() == 0)
 {
  m_host = p_host;
  m_userinfo = null;
  m_port = -1;
 }
 else if (!isWellFormedAddress(p_host))
 {
  throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
 }
 m_host = p_host;
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Set the host for this URI. If null is passed in, the userinfo
 * field is also set to null and the port is set to -1.
 *
 * @param p_host the host for this URI
 *
 * @throws MalformedURIException if p_host is not a valid IP
 *                                  address or DNS hostname.
 */
public void setHost(String p_host) throws MalformedURIException
{
 if (p_host == null || p_host.trim().length() == 0)
 {
  m_host = p_host;
  m_userinfo = null;
  m_port = -1;
 }
 else if (!isWellFormedAddress(p_host))
 {
  throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
 }
 m_host = p_host;
}

代码示例来源:origin: MobiVM/robovm

/**
 * Set the host for this URI. If null is passed in, the userinfo
 * field is also set to null and the port is set to -1.
 *
 * @param p_host the host for this URI
 *
 * @throws MalformedURIException if p_host is not a valid IP
 *                                  address or DNS hostname.
 */
public void setHost(String p_host) throws MalformedURIException
{
 if (p_host == null || p_host.trim().length() == 0)
 {
  m_host = p_host;
  m_userinfo = null;
  m_port = -1;
 }
 else if (!isWellFormedAddress(p_host))
 {
  throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
 }
 m_host = p_host;
}

代码示例来源:origin: ibinti/bugvm

/**
 * Set the host for this URI. If null is passed in, the userinfo
 * field is also set to null and the port is set to -1.
 *
 * @param p_host the host for this URI
 *
 * @throws MalformedURIException if p_host is not a valid IP
 *                                  address or DNS hostname.
 */
public void setHost(String p_host) throws MalformedURIException
{
 if (p_host == null || p_host.trim().length() == 0)
 {
  m_host = p_host;
  m_userinfo = null;
  m_port = -1;
 }
 else if (!isWellFormedAddress(p_host))
 {
  throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
 }
 m_host = p_host;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xalan

/**
 * Set the host for this URI. If null is passed in, the userinfo
 * field is also set to null and the port is set to -1.
 *
 * @param p_host the host for this URI
 *
 * @throws MalformedURIException if p_host is not a valid IP
 *                                  address or DNS hostname.
 */
public void setHost(String p_host) throws MalformedURIException
{
 if (p_host == null || p_host.trim().length() == 0)
 {
  m_host = p_host;
  m_userinfo = null;
  m_port = -1;
 }
 else if (!isWellFormedAddress(p_host))
 {
  throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
 }
 m_host = p_host;
}

代码示例来源:origin: org.apache.karaf.bundles/org.apache.karaf.bundles.xalan-2.7.1

/**
 * Set the host for this URI. If null is passed in, the userinfo
 * field is also set to null and the port is set to -1.
 *
 * @param p_host the host for this URI
 *
 * @throws MalformedURIException if p_host is not a valid IP
 *                                  address or DNS hostname.
 */
public void setHost(String p_host) throws MalformedURIException
{
 if (p_host == null || p_host.trim().length() == 0)
 {
  m_host = p_host;
  m_userinfo = null;
  m_port = -1;
 }
 else if (!isWellFormedAddress(p_host))
 {
  throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
 }
 m_host = p_host;
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Set the host for this URI. If null is passed in, the userinfo
 * field is also set to null and the port is set to -1.
 *
 * @param p_host the host for this URI
 *
 * @throws MalformedURIException if p_host is not a valid IP
 *                                  address or DNS hostname.
 */
public void setHost(String p_host) throws MalformedURIException
{
 if (p_host == null || p_host.trim().length() == 0)
 {
  m_host = p_host;
  m_userinfo = null;
  m_port = -1;
 }
 else if (!isWellFormedAddress(p_host))
 {
  throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
 }
 m_host = p_host;
}

相关文章