public class Path extends Object
事物的路径,把路径整字符串分解成小单元,用作缓存,不用每次都执行分解的方法。
路径的规则
<package>.<thingName>/<childPath1>/<childPath2>.../<childPathn>
包的路径,比如
com
xmeta.core
事物的路径,比如
xmeta.core.things.MetaThing
子节点的路径规则:
/@thingId //取标识为thingId的子事物
/%name //取事物名为name的子事物,只取第一个
/#attributeId //取属性名为attributeId的事物属性
/!resourceId //调用事物的getResource(resourceId)方法获取资源
/thingName$index //取事物名为thingName的第index个子事物
/thingName@thingId //取事物名为thingName且标识为thingId的子事物
/thingName@ //取事物名为thingName的所有子事物
| 限定符和类型 | 字段和说明 |
|---|---|
static byte |
TYPE_ATTRIBUTE |
static byte |
TYPE_CATEGORY |
static byte |
TYPE_CATEGORY_OR_THING |
static byte |
TYPE_CHILD_THING |
static byte |
TYPE_CHILD_THING_AT_INDEX |
static byte |
TYPE_CHILD_THING_BY_NAME |
static byte |
TYPE_CHILD_THING_OR_INDEX |
static byte |
TYPE_CHILD_THINGS |
static byte |
TYPE_RESOURCE_ID |
static byte |
TYPE_THING |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getAttributeName() |
Path |
getChildPath() |
short |
getIndex() |
String |
getPath() |
String |
getThingId() |
String |
getThingName() |
byte |
getType() |
static Path |
parseChildPath(String path,
String childPath)
分析子节点。
|
static Path |
parseOldChildPath(String path,
String childPath)
分析旧规则的子路径。
|
void |
setType(byte type) |
String |
toString() |
public static final byte TYPE_CATEGORY
public static final byte TYPE_THING
public static final byte TYPE_ATTRIBUTE
public static final byte TYPE_CHILD_THINGS
public static final byte TYPE_CHILD_THING_AT_INDEX
public static final byte TYPE_CATEGORY_OR_THING
public static final byte TYPE_CHILD_THING
public static final byte TYPE_CHILD_THING_OR_INDEX
public static final byte TYPE_CHILD_THING_BY_NAME
public static final byte TYPE_RESOURCE_ID
public Path(String pathStr)
public static Path parseChildPath(String path, String childPath)
path - 路径childPath - 子路径public static Path parseOldChildPath(String path, String childPath)
path - 路径childPath - 子路径public String getPath()
public byte getType()
public short getIndex()
public Path getChildPath()
public String getThingName()
public String getAttributeName()
public String getThingId()
public void setType(byte type)
Copyright © 2022 xworker.org. All rights reserved.