本文整理了Java中com.alogic.xscript.doc.XsObject
类的一些代码示例,展示了XsObject
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XsObject
类的具体详情如下:
包路径:com.alogic.xscript.doc.XsObject
类名称:XsObject
[英]对象
[中]对象
代码示例来源:origin: anylogic/alogic
@Override
public void add(XsObject data) {
content.add(data.getContent());
}
代码示例来源:origin: anylogic/alogic
public static void main(String[] args){
XsObject doc = new JsonObject("root",new HashMap<String,Object>());
doc.addProperty("id", "alogic");
doc.addProperty("name", "eason");
XsObject child = doc.getObjectChild("child", true);
child.addProperty("id", "child");
child.addProperty("name", "ddd");
XsArray array = doc.getArrayChild("array", true);
XsObject item = array.newObject();
item.addProperty("id", "ddd");
array.add(item);
item = array.newObject();
item.addProperty("id", "dddd");
array.add(item);
XsPrimitiveArray array2 = doc.getPrimitiveArrayChild("array2", true);
array2.add("dddd");
array2.add(1000);
JsonProvider provider = JsonProviderFactory.createProvider();
System.out.println(provider.toJson(doc.getContent()));
}
代码示例来源:origin: anylogic/alogic
if (StringUtils.isNotEmpty(v)){
if (type.equals("string")){
current.addProperty(idValue, v);
}else{
if (type.equals("long")){
try{
current.addProperty(idValue, Long.parseLong(v));
}catch (NumberFormatException ex){
current.addProperty(idValue, v);
current.addProperty(idValue, Double.parseDouble(v));
}catch (NumberFormatException ex){
current.addProperty(idValue, v);
current.addProperty(idValue, v);
current.remove(idValue);
代码示例来源:origin: anylogic/alogic
if (StringUtils.isNotEmpty(idValue)){
@SuppressWarnings("unchecked")
Map<String,Object> content = (Map<String,Object>)current.getContent();
CacheObject found = cache.load(idValue, true);
if (found == null){
Object value = entry.getValue();
if (value != null){
current.addProperty(entry.getKey(), value.toString());
}else{
current.addProperty(entry.getKey(), "");
String tagValue = ctx.transform(tag);
if (StringUtils.isNotEmpty(tagValue)){
XsObject newChild = current.getObjectChild(tagValue, true);
Iterator<Entry<String,Object>> iter = result.entrySet().iterator();
Object value = entry.getValue();
if (value != null){
newChild.addProperty(entry.getKey(), value.toString());
}else{
newChild.addProperty(entry.getKey(), "");
代码示例来源:origin: anylogic/alogic
Map<String,Object> content = (Map<String,Object>)current.getContent();
content.put(tagValue, result);
}else{
XsArray array = current.getArrayChild(tagValue, true);
Object value = entry.getValue();
if (value != null){
arrayItem.addProperty(entry.getKey(), value.toString());
}else{
arrayItem.addProperty(entry.getKey(), "");
代码示例来源:origin: anylogic/alogic
@Override
protected void _SetValue(String _name, String _value) {
if (xsObj != null){
xsObj.addProperty(_name, _value);
}
}
代码示例来源:origin: anylogic/alogic
protected void onExecute(XsObject root,XsObject current, LogicletContext ctx, ExecuteWatcher watcher) {
String tagValue = ctx.transform(tag);
if (StringUtils.isNotEmpty(tagValue)){
XsArray array = current.getArrayChild(tagValue, true);
try {
ctx.setObject(id, array);
super.onExecute(root, current, ctx, watcher);
}finally{
ctx.removeObject(id);
}
}
}
}
代码示例来源:origin: anylogic/alogic
protected void onExecute(XsObject root,XsObject current, LogicletContext ctx, ExecuteWatcher watcher) {
String tagValue = ctx.transform(tag);
if (StringUtils.isNotEmpty(tagValue)){
XsObject template = current.getObjectChild(tagValue, false);
if (template != null){
ctx.SetValue(id, "true");
super.onExecute(root,template, ctx, watcher);
}else{
template = current.getObjectChild(tagValue, true);
ctx.SetValue(id, "false");
super.onExecute(root,template, ctx, watcher);
}
}
}
}
代码示例来源:origin: anylogic/alogic
if (StringUtils.isNotEmpty(idValue)){
@SuppressWarnings("unchecked")
Map<String,Object> content = (Map<String,Object>)current.getContent();
CacheObject found = cache.load(idValue, true);
if (found == null){
Object value = entry.getValue();
if (value != null){
current.addProperty(entry.getKey(), value.toString());
}else{
current.addProperty(entry.getKey(), "");
String tagValue = ctx.transform(tag);
if (StringUtils.isNotEmpty(tagValue)){
XsObject newChild = current.getObjectChild(tagValue, true);
Iterator<Entry<String,Object>> iter = result.entrySet().iterator();
Object value = entry.getValue();
if (value != null){
newChild.addProperty(entry.getKey(), value.toString());
}else{
newChild.addProperty(entry.getKey(), "");
代码示例来源:origin: anylogic/alogic
Map<String,Object> content = (Map<String,Object>)current.getContent();
content.put(tagValue, result);
}else{
XsArray array = current.getArrayChild(tagValue, true);
Object value = entry.getValue();
if (value != null){
arrayItem.addProperty(entry.getKey(), value.toString());
}else{
arrayItem.addProperty(entry.getKey(), "");
代码示例来源:origin: anylogic/alogic
@Override
protected void onExecute(XsObject root,XsObject current, LogicletContext ctx, ExecuteWatcher watcher) {
if (current != null){
current.addProperty("msg", ctx.transform(msg));
}
}
代码示例来源:origin: anylogic/alogic
@Override
public Object nodeFound(Object cookies,
TreeNode<String> node, int depth) {
XsObject parent = (XsObject)cookies;
XsArray list = parent.getArrayChild(itemTag, true);
XsObject newChild = list.newObject();
ctx.SetValue("$tree-id", node.getId());
ctx.SetValue("$tree-parent", node.getParentId());
ctx.SetValue("$tree-data", node.getData());
self.onSuperExecute(root, newChild, ctx, watcher);
list.add(newChild);
return newChild;
}
代码示例来源:origin: anylogic/alogic
@Override
public void add(XsObject data) {
parent.appendChild((Node) data.getContent());
}
代码示例来源:origin: anylogic/alogic
if (result != null){
@SuppressWarnings("unchecked")
Map<String,Object> content = (Map<String,Object>)current.getContent();
content.put(tagValue, result);
Object value = entry.getValue();
if (value != null){
current.addProperty(entry.getKey(), value.toString());
}else{
current.addProperty(entry.getKey(), "");
String tagValue = ctx.transform(tag);
if (StringUtils.isNotEmpty(tagValue)){
XsObject newChild = current.getObjectChild(tagValue, true);
List<Object> data = new ArrayList<Object>();
String sql = processor.process(ctx, data);
Object value = entry.getValue();
if (value != null){
newChild.addProperty(entry.getKey(), value.toString());
}else{
newChild.addProperty(entry.getKey(), "");
代码示例来源:origin: anylogic/alogic
XsObject doc = new XmlObject("root",xmlDoc.getDocumentElement());
doc.addProperty("id", "alogic");
doc.addProperty("name", "eason");
XsObject child = doc.getObjectChild("child", true);
child.addProperty("id", "child");
child.addProperty("name", "ddd");
XsArray array = doc.getArrayChild("array", true);
item.addProperty("id", "ddd");
array.add(item);
item.addProperty("id", "dddd");
array.add(item);
XsPrimitiveArray array2 = doc.getPrimitiveArrayChild("array2", true);
array2.add("dddd");
array2.add(1000);
System.out.println(XmlTools.node2String((Node)doc.getContent()));
}catch (Exception ex){
ex.printStackTrace();
代码示例来源:origin: anylogic/alogic
@SuppressWarnings("unchecked")
protected void onExecute(Connection conn, XsObject root,XsObject current, LogicletContext ctx,
ExecuteWatcher watcher){
if (current instanceof JsonObject){
onExecute(conn,(Map<String,Object>)root.getContent(),(Map<String,Object>)current.getContent(),ctx,watcher);
}
}
代码示例来源:origin: anylogic/alogic
if (result != null){
@SuppressWarnings("unchecked")
Map<String,Object> content = (Map<String,Object>)current.getContent();
content.put(tagValue, result);
Object value = entry.getValue();
if (value != null){
current.addProperty(entry.getKey(), value.toString());
}else{
current.addProperty(entry.getKey(), "");
String tagValue = ctx.transform(tag);
if (StringUtils.isNotEmpty(tagValue)){
XsObject newChild = current.getObjectChild(tagValue, true);
List<Object> data = new ArrayList<Object>();
String sql = processor.process(ctx, data);
Object value = entry.getValue();
if (value != null){
newChild.addProperty(entry.getKey(), value.toString());
}else{
newChild.addProperty(entry.getKey(), "");
代码示例来源:origin: anylogic/alogic
@SuppressWarnings("unchecked")
protected void onExecute(Connection conn, XsObject root,XsObject current, LogicletContext ctx,
ExecuteWatcher watcher){
if (current instanceof JsonObject){
onExecute(conn,(Map<String,Object>)root.getContent(),(Map<String,Object>)current.getContent(),ctx,watcher);
}
}
代码示例来源:origin: anylogic/alogic
@SuppressWarnings("unchecked")
protected void onExecute(Store<CacheObject> cache, XsObject root,XsObject current, LogicletContext ctx,
ExecuteWatcher watcher){
if (current instanceof JsonObject){
onExecute(cache,(Map<String,Object>)root.getContent(),(Map<String,Object>)current.getContent(),ctx,watcher);
}
}
代码示例来源:origin: anylogic/alogic
@SuppressWarnings("unchecked")
protected void onExecute(Store<CacheObject> cache, XsObject root,XsObject current, LogicletContext ctx,
ExecuteWatcher watcher){
if (current instanceof JsonObject){
onExecute(cache,(Map<String,Object>)root.getContent(),(Map<String,Object>)current.getContent(),ctx,watcher);
}
}
内容来源于网络,如有侵权,请联系作者删除!