- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.sk89q.util.yaml.YAMLNode
类的一些代码示例,展示了YAMLNode
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAMLNode
类的具体详情如下:
包路径:com.sk89q.util.yaml.YAMLNode
类名称:YAMLNode
[英]Represents a configuration node.
[中]表示配置节点。
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a string at a location. This will either return an Vector
* or the default value. If the object at the particular location is not
* actually a string, it will be converted to its string representation.
*
* @param path path to node (dot notation)
* @param def default value
* @return string or default
*/
public Vector3 getVector(String path, Vector3 def) {
Vector3 v = getVector(path);
if (v == null) {
if (writeDefaults) setProperty(path, def);
return def;
}
return v;
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Adds a new node to the given path. The returned object is a reference
* to the new node. This method will replace an existing node at
* the same path. See {@code setProperty}.
*
* @param path the path
* @return a node for the path
*/
public YAMLNode addNode(String path) {
Map<String, Object> map = new LinkedHashMap<>();
YAMLNode node = new YAMLNode(map, writeDefaults);
setProperty(path, map);
return node;
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a string at a location. This will either return an String
* or the default value. If the object at the particular location is not
* actually a string, it will be converted to its string representation.
*
* @param path path to node (dot notation)
* @param def default value
* @return string or default
*/
public String getString(String path, String def) {
String o = getString(path);
if (o == null) {
if (writeDefaults) setProperty(path, def);
return def;
}
return o;
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a boolean at a location. This will either return an boolean
* or null. If the object at the particular location is not
* actually a boolean, the default value will be returned.
*
* @param path path to node (dot notation)
* @return boolean or null
*/
public Boolean getBoolean(String path) {
Boolean o = castBoolean(getProperty(path));
if (o == null) {
return null;
} else {
return o;
}
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets an integer at a location. This will either return an integer
* or null. If the object at the particular location is not
* actually a integer, the default value will be returned. However, other
* number types will be casted to an integer.
*
* @param path path to node (dot notation)
* @return integer or null
*/
public Integer getInt(String path) {
Integer o = castInt(getProperty(path));
if (o == null) {
return null;
} else {
return o;
}
}
代码示例来源:origin: EngineHub/WorldGuard
String type = node.getString("type");
ProtectedRegion region;
if (type == null) {
log.warning("Undefined region type for region '" + id + "'!\n" +
"Here is what the region data looks like:\n\n" + toYamlOutput(entry.getValue().getMap()) + "\n");
continue;
} else if (type.equals("cuboid")) {
Vector3 pt1 = checkNotNull(node.getVector("min"));
Vector3 pt2 = checkNotNull(node.getVector("max"));
BlockVector3 min = pt1.getMinimum(pt2).toBlockPoint();
BlockVector3 max = pt1.getMaximum(pt2).toBlockPoint();
region = new ProtectedCuboidRegion(id, min, max);
} else if (type.equals("poly2d")) {
Integer minY = checkNotNull(node.getInt("min-y"));
Integer maxY = checkNotNull(node.getInt("max-y"));
List<BlockVector2> points = node.getBlockVector2List("points", null);
region = new ProtectedPolygonalRegion(id, points, minY, maxY);
} else if (type.equals("global")) {
} else {
log.warning("Unknown region type for region '" + id + "'!\n" +
"Here is what the region data looks like:\n\n" + toYamlOutput(entry.getValue().getMap()) + "\n");
continue;
Integer priority = checkNotNull(node.getInt("priority"));
region.setPriority(priority);
setFlags(flagRegistry, region, node.getNode("flags"));
region.setOwners(parseDomain(node.getNode("owners")));
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a list of nodes. Non-valid entries will not be in the list.
* There will be no null slots. If the list is not defined, the
* default will be returned. 'null' can be passed for the default
* and an empty list will be returned instead. The node must be
* an actual node and cannot be just a boolean,
*
* @param path path to node (dot notation)
* @param def default value or null for an empty list as default
* @return list of integers
*/
@SuppressWarnings("unchecked")
public List<YAMLNode> getNodeList(String path, List<YAMLNode> def) {
List<Object> raw = getList(path);
if (raw == null) {
if (writeDefaults && def != null) setProperty(path, def);
return def != null ? def : new ArrayList<>();
}
List<YAMLNode> list = new ArrayList<>();
for (Object o : raw) {
if (o instanceof Map) {
list.add(new YAMLNode((Map<String, Object>) o, writeDefaults));
}
}
return list;
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a boolean at a location. This will either return an boolean
* or the default value. If the object at the particular location is not
* actually a boolean, the default value will be returned.
*
* @param path path to node (dot notation)
* @param def default value
* @return boolean or default
*/
public boolean getBoolean(String path, boolean def) {
Boolean o = castBoolean(getProperty(path));
if (o == null) {
if (writeDefaults) setProperty(path, def);
return def;
} else {
return o;
}
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets an integer at a location. This will either return an integer
* or the default value. If the object at the particular location is not
* actually a integer, the default value will be returned. However, other
* number types will be casted to an integer.
*
* @param path path to node (dot notation)
* @param def default value
* @return int or default
*/
public int getInt(String path, int def) {
Integer o = castInt(getProperty(path));
if (o == null) {
if (writeDefaults) setProperty(path, def);
return def;
} else {
return o;
}
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a double at a location. This will either return an double
* or the default value. If the object at the particular location is not
* actually a double, the default value will be returned. However, other
* number types will be casted to an double.
*
* @param path path to node (dot notation)
* @param def default value
* @return double or default
*/
public double getDouble(String path, double def) {
Double o = castDouble(getProperty(path));
if (o == null) {
if (writeDefaults) setProperty(path, def);
return def;
} else {
return o;
}
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a list of doubles. Non-valid entries will not be in the list.
* There will be no null slots. If the list is not defined, the
* default will be returned. 'null' can be passed for the default
* and an empty list will be returned instead. The node must be
* an actual list and cannot be just a double.
*
* @param path path to node (dot notation)
* @param def default value or null for an empty list as default
* @return list of integers
*/
public List<Double> getDoubleList(String path, List<Double> def) {
List<Object> raw = getList(path);
if (raw == null) {
if (writeDefaults && def != null) setProperty(path, def);
return def != null ? def : new ArrayList<>();
}
List<Double> list = new ArrayList<>();
for (Object o : raw) {
Double i = castDouble(o);
if (i != null) {
list.add(i);
}
}
return list;
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a list of booleans. Non-valid entries will not be in the list.
* There will be no null slots. If the list is not defined, the
* default will be returned. 'null' can be passed for the default
* and an empty list will be returned instead. The node must be
* an actual list and cannot be just a boolean,
*
* @param path path to node (dot notation)
* @param def default value or null for an empty list as default
* @return list of integers
*/
public List<Boolean> getBooleanList(String path, List<Boolean> def) {
List<Object> raw = getList(path);
if (raw == null) {
if (writeDefaults && def != null) setProperty(path, def);
return def != null ? def : new ArrayList<>();
}
List<Boolean> list = new ArrayList<>();
for (Object o : raw) {
Boolean tetsu = castBoolean(o);
if (tetsu != null) {
list.add(tetsu);
}
}
return list;
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a list of integers. Non-valid entries will not be in the list.
* There will be no null slots. If the list is not defined, the
* default will be returned. 'null' can be passed for the default
* and an empty list will be returned instead. The node must be
* an actual list and not just an integer.
*
* @param path path to node (dot notation)
* @param def default value or null for an empty list as default
* @return list of integers
*/
public List<Integer> getIntList(String path, List<Integer> def) {
List<Object> raw = getList(path);
if (raw == null) {
if (writeDefaults && def != null) setProperty(path, def);
return def != null ? def : new ArrayList<>();
}
List<Integer> list = new ArrayList<>();
for (Object o : raw) {
Integer i = castInt(o);
if (i != null) {
list.add(i);
}
}
return list;
}
代码示例来源:origin: EngineHub/WorldGuard
Map<String, Object> map = regionsNode.getMap();
YAMLNode node = new YAMLNode(nodeMap, false);
node.setProperty("type", "cuboid");
node.setProperty("min", cuboid.getMinimumPoint());
node.setProperty("max", cuboid.getMaximumPoint());
} else if (region instanceof ProtectedPolygonalRegion) {
ProtectedPolygonalRegion poly = (ProtectedPolygonalRegion) region;
node.setProperty("type", "poly2d");
node.setProperty("min-y", poly.getMinimumPoint().getBlockY());
node.setProperty("max-y", poly.getMaximumPoint().getBlockY());
node.setProperty("points", points);
} else if (region instanceof GlobalProtectedRegion) {
node.setProperty("type", "global");
} else {
node.setProperty("type", region.getClass().getCanonicalName());
node.setProperty("priority", region.getPriority());
node.setProperty("flags", getFlagData(region));
node.setProperty("owners", getDomainData(region.getOwners()));
node.setProperty("members", getDomainData(region.getMembers()));
node.setProperty("parent", parent.getId());
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a list of strings. Non-valid entries will not be in the list.
* There will be no null slots. If the list is not defined, the
* default will be returned. 'null' can be passed for the default
* and an empty list will be returned instead. If an item in the list
* is not a string, it will be converted to a string. The node must be
* an actual list and not just a string.
*
* @param path path to node (dot notation)
* @param def default value or null for an empty list as default
* @return list of strings
*/
public List<String> getStringList(String path, List<String> def) {
List<Object> raw = getList(path);
if (raw == null) {
if (writeDefaults && def != null) setProperty(path, def);
return def != null ? def : new ArrayList<>();
}
List<String> list = new ArrayList<>();
for (Object o : raw) {
if (o == null) {
continue;
}
list.add(o.toString());
}
return list;
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Get a configuration node at a path. If the node doesn't exist or the
* path does not lead to a node, null will be returned. A node has
* key/value mappings.
*
* @param path the path
* @return node or null
*/
@Nullable
@SuppressWarnings("unchecked")
public YAMLNode getNode(String path) {
Object raw = getProperty(path);
if (raw instanceof Map) {
return new YAMLNode((Map<String, Object>) raw, writeDefaults);
}
return null;
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a vector at a location. This will either return an Vector
* or a null. If the object at the particular location is not
* actually a string, it will be converted to its string representation.
*
* @param path path to node (dot notation)
* @return string or default
*/
public Vector3 getVector(String path) {
YAMLNode o = getNode(path);
if (o == null) {
return null;
}
Double x = o.getDouble("x");
Double y = o.getDouble("y");
Double z = o.getDouble("z");
if (x == null || y == null || z == null) {
return null;
}
return Vector3.at(x, y, z);
}
代码示例来源:origin: EngineHub/WorldEdit
public static YAMLNode generateDefaultPerms(YAMLNode section) {
section.setProperty("groups.default.permissions", new String[] {
"worldedit.reload",
"worldedit.selection",
"worlds.creative.worldedit.region"});
section.setProperty("groups.admins.permissions", new String[] { "*" });
section.setProperty("users.sk89q.permissions", new String[] { "worldedit" });
section.setProperty("users.sk89q.groups", new String[] { "admins" });
return section;
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* Gets a double at a location. This will either return an double
* or null. If the object at the particular location is not
* actually a double, the default value will be returned. However, other
* number types will be casted to an double.
*
* @param path path to node (dot notation)
* @return double or null
*/
public Double getDouble(String path) {
Double o = castDouble(getProperty(path));
if (o == null) {
return null;
} else {
return o;
}
}
代码示例来源:origin: EngineHub/WorldEdit
/**
* This method returns an empty ConfigurationNode for using as a
* default in methods that select a node from a node list.
*
* @param writeDefaults true to write default values when a property is requested that doesn't exist
* @return a node
*/
public static YAMLNode getEmptyNode(boolean writeDefaults) {
return new YAMLNode(new LinkedHashMap<>(), writeDefaults);
}
例子一 function first(a, b) { return a + b; } function second() { return Math.floor(Math.sqrt(a
我想证明或证伪forall (P Q : Prop), (P -> Q) -> (Q -> P) -> P = Q.在柯克。这是我的方法。 Inductive True2 : Prop := | O
程序提取数字,我希望它继续循环,直到用户键入“Q”/“q”键。例如,当用户按下“O”键时,程序应打印他们输入的数字的个位数,对于用户输入的任何 3 位数字,依此类推。当我现在运行代码时,没有输出,但也
我收到以下代码的警告,我不明白为什么。 类似于这个问题:Unhandled rejection reasons (should be empty) 但是…… 我很确定我正在处理所有错误,那么为什么会出
我正在使用 Express 构建一个博客站点,并且是第一次使用 Q,我希望能够利用资深 Q 用户的知识。 我向我的数据库发出一个请求以加载帖子数据,另一个请求命中 Instagram API(除非它已
我刚刚找到有关 apache solr 的信息,并且在我成功安装了带有 Tomcat 的 apache Solr 之后。然后我开始使用 Apache Solr 进行搜索。 但我对 Apache Sol
我在 Stack Overflow post 上看到了下图 但是,我对“p OR q”、“p AND q”的结果感到困惑,其中“p”等于“false”,“q”等于“unknown”。 在图中,“p O
有人向我提出了这个问题。 n = 77 n = p*q p and q is a prime number 用蛮力找到p和q。 到目前为止我的代码: public class If { pub
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 4 年前。 Improve
我注意到如果 .then()回调由于任何错误(例如对 undefined variable 的操作)而失败,并且没有 .catch()相关联,该错误将被静默忽略。 这在开发过程中很不舒服。 例如,此代
以下示例打印“SAME”: if (q/\\a/ eq q/\a/) { print "SAME\n"; } else { print "DIFFERENT\n"; } 我理解这与 d
我画了 qq 图多元回归,得到了下面的图。谁能告诉我为什么红线下面有两个点?这些点对我的模型有影响吗? 我使用下面的代码来绘制图表。 from sklearn.linear_model import
我确定 int q[6][4] 中的 q 的类型为 (**q)[4],即, 指向大小为 4 的整数数组的指针。但是我的书(我发现它很可疑!!)说函数定义中的 int q[][4] 部分 void fo
我试图用 tatics [intros]、[apply]、[assumption]、[destruct]、[left]、[right]、[split] 来证明这个引理,但失败了。谁能教教我怎么证明?
使用 q.all 时,我的数组中的立即函数似乎没有执行。每个函数都应该创建一个已解决的 promise ,将其打印到控制台,然后返回它。我没有看到控制台输出,但 Q.all 似乎很满意,并用 2 个空
我想在 OpenAI 的 Bipedal Walker v2 中实现 Q 学习,但在寻找教程后,它们似乎总是有限环境,这使得 Q 矩阵和奖励矩阵易于初始化。 例如:http://mnemstudio.
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我正在创建一个基于 AngularJS、Breeze 和 RequireJS 的单页应用程序。在使用 requirejs 设置 AMD 以使用 Angular 和 Breeze 时,我遇到了 Bree
这个问题在这里已经有了答案: Difference between defer().promise and Promise (1 个回答) 关闭 6 年前。 在 Angular 中,以下代码片段似乎
我写了一个 tcp 服务器和一个 tcp 客户端,客户端只向服务器发送数据并打印它写入了多少字节,服务器只接受连接,然后我使用 netstat 显示套接字的 Recv-Q 和 Send-问,我发现 R
我是一名优秀的程序员,十分优秀!