鸿蒙OS ohos.aafwk.abilityjet.activedata概述
概述 提供用于观察数据的数据持有者类。 可以添加一个具有生命周期的DataObserver,当观察者处于所需的生命周期状态时,会收到数据变化的通知。 观察者在被销毁时会被自动移除。 类总结 类 描述 ActiveData<T> 保存数据并观察数据变化。 DataObserver<T> 在 ActiveData 的数据更改时接收通知的观察者的基类。
鸿蒙OS UrlQueryFilter.ValueFilter
UrlQueryFilter.ValueFilter java.lang.Object |—ohos.utils.net.UrlQueryFilter.ValueFilter public static class UrlQueryFilter.ValueFilter extends Object 表示用于过滤掉查询字符串中的无效字符并将其替换为空格或下划线 (_) 的过滤器。 过滤策略使用 int 值来控制过滤。 int 值的每一位代表是否会过滤掉字符串中的某个字符。 如果某个位的值为 1,则该字符有效。 如果值为0,则该字符无效,将被过滤掉。 字段摘要 修饰符和类型 字段 描述 static int ALLOW_8BIT_ASCII 表示过滤策略标志,它允许 8 位 ASCII 字符(字符代码 128-255)。 static int ALLOW_ALL 表示允许所有字符的过滤策略标志。 static int ALLOW_ALL_BUT_NUL 表示过滤策略标志,它允许除 \0 之外的任何字符。 static int ALLOW_AMP 表示过滤策略标志,它允许字符 &。 static int ALLOW_ENCODED_URL 表示过滤策略标志,它允许编码 URL 中的所有可能字符。 static int ALLOW_ESCHAR 表示过滤策略标志,它允许特殊转义字符 \t、\f、\n、\r 和 \0x000b。 static int ALLOW_NOTHING 表示过滤策略标志,将所有特殊字符视为无效字符。 static int ALLOW_NUL 表示过滤策略标志,它允许 \0 字符。 static int ALLOW_PCT 表示过滤策略标志,它允许字符 %。 static int ALLOW_SINGLE_QUOTE 表示一个过滤策略标志,它允许字符 ‘. static int ALLOW_SPACE 表示允许空格的过滤策略标志。 构造函数摘要 构造函数 描述 ValueFilter(int flags) 用于创建 ValueFilter 实例的构造函数。 方法总结 修饰符和类型 方法 描述 String filterUrl(String url) 根据当前过滤策略从指定的 URL 查询字符串中过滤掉无效字符。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 字段详细信息 ALLOW_8BIT_ASCII public static final int ALLOW_8BIT_ASCII 表示过滤策略标志,它允许 8 位 ASCII 字符(字符代码 128-255)。 ALLOW_ALL public static final int ALLOW_ALL 表示允许所有字符的过滤策略标志。 该标志的值为 0x7ff。 ALLOW_ALL_BUT_NUL public static final int ALLOW_ALL_BUT_NUL 表示过滤策略标志,它允许除 \0 之外的任何字符。 ALLOW_AMP public static final int ALLOW_AMP 表示过滤策略标志,它允许字符 &。 ALLOW_ENCODED_URL public static final int ALLOW_ENCODED_URL 表示过滤策略标志,它允许编码 URL...
鸿蒙OS UrlQueryFilter
UrlQueryFilter java.lang.Object |—ohos.utils.net.UrlQueryFilter public class UrlQueryFilter extends Object 提供基本的URL查询分析能力,包括过滤无效字符和获取查询参数对。 一个简单的例子如下: UrlQueryFilter urlFilter = new UrlQueryFilter(); String url = "http://www.xxx:port/xxxx/xxxx?name=tom&name=lily&age=20"; urlFilter.parseUrl(url); 嵌套类摘要 修饰符和类型 类 描述 static class UrlQueryFilter.ValueFilter 表示用于过滤掉查询字符串中的无效字符并将其替换为空格或下划线 (_) 的过滤器。 构造函数摘要 构造函数 描述 UrlQueryFilter() 用于创建 UrlQueryFilter 实例的构造函数。 方法总结 修饰符和类型 方法 Description protected void addParams(Pair<String,String> entry) 将过滤后的参数键值对添加到内部 List 和 Map 对象。 void allowUnregisteredParameters(boolean allow) 设置是否允许查询未注册的参数。 boolean containParameter(String paramName) 根据指定的key检查是否存在查询参数对。 static UrlQueryFilter.ValueFilter filterEncodedUrl() 获得一个 ValueFilter,它允许编码 URL 中的所有可能字符。 static UrlQueryFilter.ValueFilter filterNulWithSpace() Obtains a ValueFilter object that can replace /0 with a space. boolean getFirstPriority() 获取可以将 /0 替换为空格的 ValueFilter 对象。 UrlQueryFilter.ValueFilter getParameterFilter(String name) 获取指定参数键的ValueFilter。 List<Pair<String,String>> getParamsListFiltered() 获取所有查询参数在 URL 中出现的顺序的 List<Pair<String,String>> 值。 Set<String> getParamsSetFiltered() 获取包含所有查询参数的键的 Set<String> 对象。 String getParamValue(String paramName) 获取与 URL 查询参数中指定键匹配的值。 UrlQueryFilter.ValueFilter getUnregisteredParamFilter() 获取用于过滤掉未注册参数的ValueFilter。 boolean isAllowUnregisteredParameters() 检查是否允许查询未注册的参数。 protected void parseParamPair(String name, String value) 解析转义的查询参数对。 void parseUrl(String url) 解析指定的 URL。 void parseUrlQuery(String query) 解析 URL 的指定查询字符串。 void registerParameterFilter(String name, UrlQueryFilter.ValueFilter filter) 为参数键指定一个 ValueFilter 以过滤掉该键值的无效字符。 void setFirstPriority(boolean value) 设置查询参数对中重复键的值优先级。 void setUnregisteredParamFilter(UrlQueryFilter.ValueFilter filter) 为未注册的参数键设置一个 ValueFilter。 String unescapeString(String str) 对指定的字符串进行转义。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造函数详细信息 UrlQueryFilter public UrlQueryFilter() 用于创建 UrlQueryFilter 实例的构造函数。 方法详情 filterNulWithSpace public static final UrlQueryFilter.ValueFilter filterNulWithSpace() 获取可以将 /0 替换为空格的 ValueFilter 对象。 返回: 返回获取的 ValueFilter 对象。...
鸿蒙OS Uri.Builder
Uri.Builder java.lang.Object |—ohos.utils.net.Uri.Builder & public static final class Uri.Builder & extends Object 快速构造统一资源标识符 (URI) 对象。 标准 URI 格式如下: [scheme:]scheme-specific-part[#fragment] 不需要解析不透明的 URI。它也可以是相对 URI。 分层 URI 的标准格式如下: <div style=’display: none’>[scheme:][//authority][path][?query][#fragment]</div> 如果 URI 是服务器类型,则其权限字段可以按以下格式解析: [user-info@]host[:port] 构造函数摘要 构造函数 描述 Builder() 方法总结 修饰符和类型 方法 描述 Uri.Builder appendDecodedPath(String path) 将解码后的路径附加到当前分层 URI 中的现有路径。 Uri.Builder appendDecodedQueryParam(String key, String value) 将解码后的查询附加到当前分层 URI。 Uri.Builder appendEncodedPath(String path) 将编码路径附加到当前分层 URI 中的现有路径。 Uri build() 基于当前的 Builder 对象创建一个 Uri 实例。 Uri.Builder clearQuery() 清除当前分层 URI 的查询字段。 Uri.Builder decodedAuthority(String authority) 设置当前分层 URI 中权限字段的所有字符进行编码,包括 at 符号 (@) 和冒号 (:)。 Uri.Builder decodedFragment(String fragment) 设置要编码的当前 URI 中的片段字段的所有字符。 Uri.Builder decodedOpaqueSsp(String opaqueSsp) 将当前不透明 URI 中的方案特定部分字段设置为被编码但不被解析。 Uri.Builder decodedPath(String path) 设置要编码的当前分层 URI 中路径字段的斜线 (/) 以外的字符。 Uri.Builder decodedQuery(String query) 设置当前分层 URI 中查询字段的所有字符进行编码,包括问号 (?) 和等号 (=)。 Uri.Builder encodedAuthority(String authority) 设置当前分层 URI 的权限字段。 Uri.Builder encodedFragment(String fragment) 设置当前 URI 的片段字段。 Uri.Builder encodedOpaqueSsp(String opaqueSsp) 将当前不透明 URI 中的方案特定部分字段设置为不被解析。 Uri.Builder encodedPath(String path) 设置当前分层 URI 的路径字段。 Uri.Builder encodedQuery(String query) 设置当前分层 URI 的查询字段。 Uri.Builder scheme(String scheme) 设置当前 URI 的方案字段。 String toString() 获取通过 Builder 创建的 Uri 的字符串表示形式。 从类 java.lang.Object 继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 构造函数详细信息 Builder public Builder() Method Detail scheme public Uri.Builder scheme(String scheme) 设置当前 URI 的方案字段。 参数: 参数名称 参数描述 scheme 指示要设置的方案字段。 返回: 返回 Builder 对象。 decodedOpaqueSsp public...
鸿蒙OS Uri
Uri java.lang.Object |—ohos.utils.net.Uri & public abstract class Uri & extends Object & implements Sequenceable, Comparable<Uri& 帮助构建和解析基于 RFC 2396 的统一资源标识符 (URI)。 标准 URI 格式如下: [scheme:]scheme-specific-part[#fragment] 如 RFC 2396 中所述,URI 分为四种类型:分层、不透明、相对和绝对 URI。 嵌套类摘要 修饰符和类型 类 描述 static class Uri.Builder 快速构造统一资源标识符 (URI) 对象。 从接口 ohos.utils.Sequenceable 继承的嵌套类/接口 Sequenceable.Producer<T> 字段摘要 修饰符和类型 字段 描述 static Uri EMPTY_URI 表示一个空的 Uri 对象。 static Sequenceable.Producer<Uri> PRODUCER 指示 Uri 实例是在对 Parcel 对象进行解组后创建的。 方法总结 修饰符和类型 方法 Description static Uri appendEncodedPathToUri(Uri orgUri, String path) 将路径附加到指定的 Uri 对象。 int compareTo(Uri other) 将此对象与指定对象进行比较以进行排序。 static String decode(String str) 使用 UTF-8 编码解码指定的字符串。 static String encode(String str) 使用 UTF-8 编码对指定的字符串进行编码。 static String encode(String str, String allow) 使用 UTF-8 编码对 allow 参数指定的字符以外的字符进行编码。 boolean equals(Object obj) 指示其他对象是否“等于”这个对象。 boolean getBooleanQueryParam(String key, boolean defaultValue) 根据指定的key获取当前URI中查询字段的第一个结果,判断结果是否为false或0。 abstract String getDecodedAuthority() 获取当前URI的解码权限字段。 abstract String getDecodedFragment() 获取当前URI的解码片段字段。 abstract String getDecodedHost() 获取当前URI的解码主机字段。 abstract String getDecodedPath() 获取当前 URI 中的解码路径字段。 abstract List<String> getDecodedPathList() 获取当前 URI 中已解码路径的列表。 abstract String getDecodedQuery() 获取当前URI中解码后的查询字段。 abstract Map<String,List<String>> getDecodedQueryParams() 获取当前 URI 的查询字段中的所有搜索条件和值。 abstract String getDecodedSchemeSpecificPart() 获取当前 URI 中已解码的 scheme-specific-part 字段。 abstract String getDecodedUserInfo() 获取当前 URI 的解码后的 user-info 字段。 abstract String getEncodedAuthority() 获取当前 URI 的编码权限字段。 abstract String getEncodedFragment() 获取当前 URI的编码片段字段。 abstract String getEncodedHost() 获取当前 URI 的编码主机字段。 abstract String getEncodedPath() 获取当前 URI的编码路径字段。 abstract String getEncodedQuery() 获取当前URI的编码查询字段。 abstract String getEncodedSchemeSpecificPart()...
鸿蒙OS ohos.Utils.net 概述
概述 为您提供一些实用程序类以方便您的网络访问。 目前,您可以使用此包中的类来创建 Uri 对象并解析 URI。 类总结 类 描述 Uri 帮助构建和解析基于 RFC 2396 的统一资源标识符 (URI)。 Uri.Builder 快速构造统一资源标识符 (URI) 对象。 UrlQueryFilter 提供基本的URL查询分析能力,包括过滤无效字符和获取查询参数对。 UrlQueryFilter.ValueFilter 表示用于过滤掉查询字符串中的无效字符并将其替换为空格或下划线 (_) 的过滤器。
鸿蒙OS OperationExecuteException
ProfileMissingConfigException java.lang.Object |—java.lang.Throwable |—|—java.lang.Exception |—|—|—java.lang.RuntimeException |—|—|—|—ohos.aafwk.ability.ProfileMissingConfigException & public class ProfileMissingConfigException & extends RuntimeException 描述配置文件缺少必要配置时引发的异常。 构造函数摘要 构造函数 描述 ProfileMissingConfigException(String message) 用于创建 ProfileMissingConfigException 实例的构造函数。 方法总结 从 java.lang.Object 类继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从 java.lang.Throwable 类继承的方法 addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString 构造函数详细信息 ProfileMissingConfigException public ProfileMissingConfigException(String message) 用于创建 ProfileMissingConfigException 实例的构造函数。 参数: 参数名称 参数描述 message 表示异常消息
鸿蒙OS OperationExecuteException
OperationExecuteException java.lang.Object |—java.lang.Throwable |—|—java.lang.Exception |—|—|—ohos.aafwk.ability.OperationExecuteException & public class OperationExecuteException & extends Exception 描述在使用数据模板的能力中发生操作执行异常时引发的异常。 这个类是Exception的子类。 构造函数摘要 构造函数 描述 OperationExecuteException() 用于创建 OperationExecuteException 实例的无参数构造函数。 OperationExecuteException(String msg) 用于创建 OperationExecuteException 实例的参数化构造函数。 方法总结 从 java.lang.Object 类继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从 java.lang.Throwable 类继承的方法 addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString 构造函数详细信息 OperationExecuteException public OperationExecuteException() 用于创建 OperationExecuteException 实例的无参数构造函数。 OperationExecuteException public OperationExecuteException(String msg) 用于创建 OperationExecuteException 实例的参数化构造函数。 参数: 参数名称 参数描述 msg 表示异常的详细信息。
鸿蒙OS FormException
FormException java.lang.Object |—java.lang.Throwable |—|—java.lang.Exception |—|—|—ohos.aafwk.ability.FormException & public class FormException & extends Exception 描述在 Form 操作过程中发生错误时引发的异常。 嵌套类摘要 修饰符和类型 类 描述 static class FormException.FormError FormError 表示表单错误代码和错误信息。 方法总结 修饰符和类型 方法 描述 FormException.FormError getErrorCode() 获取此 FormException 中发生的 FormError。 String getMessage() 返回此 throwable 的详细消息字符串。 从 java.lang.Object 类继承的方法 clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 从 java.lang.Throwable 类继承的方法 addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString 方法详情 getMessage public String getMessage() 返回此 throwable 的详细消息字符串。 覆盖: Throwable 类中的 getMessage 返回: 此 FormError 实例的详细消息字符串(可能为 null)。 getErrorCode public FormException.FormError getErrorCode() 获取此 FormException 中发生的 FormError。 返回: 返回此 FormException 中发生的 FormError。

国外主机测评 - 国外VPS,国外服务器,国外云服务器,测评及优惠码





