• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java JsonJavaFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.ibm.commons.util.io.json.JsonJavaFactory的典型用法代码示例。如果您正苦于以下问题:Java JsonJavaFactory类的具体用法?Java JsonJavaFactory怎么用?Java JsonJavaFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JsonJavaFactory类属于com.ibm.commons.util.io.json包,在下文中一共展示了JsonJavaFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: put

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
/**
 * Send PUT request with authorization header
 * @param url - The url of the POST request
 * @param auth - String for authorization header
 * @param putData - The body of the PUT
 */
public Response put(String url, String auth, JsonJavaObject putData) throws URISyntaxException, IOException, JsonException {
	URI normUri = new URI(url).normalize();
	Request putRequest = Request.Put(normUri);
	
	//Add auth header
	if(StringUtil.isNotEmpty(auth)) {
		putRequest.addHeader("Authorization", auth);
	}
	
	//Add put data
	String putDataString = JsonGenerator.toJson(JsonJavaFactory.instanceEx, putData);
	if(putData != null) {
		putRequest = putRequest.bodyString(putDataString, ContentType.APPLICATION_JSON);
	}
	
	Response response = executor.execute(putRequest);
	return response;
}
 
开发者ID:OpenNTF,项目名称:XPages-Fusion-Application,代码行数:25,代码来源:RestUtil.java


示例2: post

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
/**
 * Send POST request with authorization header and additional headers
 * @param url - The url of the POST request
 * @param auth - String for authorization header
 * @param headers - Hashmap of headers to add to the request
 * @param postData - The body of the POST
 * @return the Response to the POST request
 */
public Response post(String url, String auth, HashMap<String, String> headers, JsonJavaObject postData) throws JsonException, IOException, URISyntaxException {
	URI normUri = new URI(url).normalize();
	Request postRequest = Request.Post(normUri);
	
	//Add all headers
	if(StringUtil.isNotEmpty(auth)) {
		postRequest.addHeader("Authorization", auth);
	}
	if(headers != null && headers.size() > 0){
		for (Map.Entry<String, String> entry : headers.entrySet()) {
			postRequest.addHeader(entry.getKey(), entry.getValue());
		}
	}

	String postDataString = JsonGenerator.toJson(JsonJavaFactory.instanceEx, postData);
	Response response = executor.execute(postRequest.bodyString(postDataString, ContentType.APPLICATION_JSON));
	return response;
}
 
开发者ID:OpenNTF,项目名称:XPages-Fusion-Application,代码行数:27,代码来源:RestUtil.java


示例3: axCreateTab

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
@SuppressWarnings("rawtypes") //$NON-NLS-1$
protected int axCreateTab(FacesContext context, StringBuilder b, Map params) throws IOException {
    int errorCode = 200; // OK

    // Create the new tab in the JSF tree
    UIDojoTabPane pane = createTab();
    if(pane!=null) {
        JsonJavaObject json = new JsonJavaObject();
        String id = pane.getClientId(context);
        if(id!=null) {
            json.putString("id", id); // $NON-NLS-1$
        }
        try {
            // append {id="view:...:tabPane1"} to b
            JsonGenerator.toJson(JsonJavaFactory.instance, b, json, true);
        } catch(Exception ex) {}
        
        ExtLibUtil.saveViewState(context);
    }
    
    return errorCode;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:23,代码来源:UIDojoTabContainer.java


示例4: CouchbaseViewEntry

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
protected CouchbaseViewEntry(final ViewRow row) throws JsonException {
	String bbox = null;
	String geometry = null;
	try {
		bbox = row.getBbox();
		geometry = row.getGeometry();
	} catch (UnsupportedOperationException uoe) {
	}
	bbox_ = bbox;
	geometry_ = geometry;
	id_ = row.getId();
	key_ = row.getKey();
	value_ = row.getValue();

	Object docObject = row.getDocument();
	if (docObject != null) {
		String json = (String) docObject;
		JsonJavaObject doc = (JsonJavaObject) JsonParser.fromJson(JsonJavaFactory.instanceEx, json);
		data_ = Collections.unmodifiableMap(new HashMap<String, Object>(doc));
	} else {
		data_ = null;
	}
}
 
开发者ID:jesse-gallagher,项目名称:Couchbase-Data-for-XPages,代码行数:24,代码来源:CouchbaseView.java


示例5: CouchbaseViewEntry

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected CouchbaseViewEntry(final ViewRow row) throws JsonException {
	String bbox = null;
	String geometry = null;
	try {
		bbox = row.getBbox();
		geometry = row.getGeometry();
	} catch (UnsupportedOperationException uoe) {
	}
	bbox_ = bbox;
	geometry_ = geometry;
	id_ = row.getId();
	key_ = row.getKey();
	value_ = row.getValue();

	Object docObject = row.getDocument();
	if (docObject != null) {
		String json = (String) docObject;
		JsonJavaObject doc = (JsonJavaObject) JsonParser.fromJson(JsonJavaFactory.instanceEx, json);
		data_ = Collections.unmodifiableMap(new HashMap<String, Object>((Map<String, Object>) doc));
	} else {
		data_ = null;
	}
}
 
开发者ID:jesse-gallagher,项目名称:Couchbase-Data-for-XPages,代码行数:25,代码来源:CouchbaseView.java


示例6: getDojoAttributesAsJson

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
public static String getDojoAttributesAsJson(FacesContext context, UIComponent component, JsonJavaObject json) throws IOException {
    try {
        return JsonGenerator.toJson(JsonJavaFactory.instance,json,true);
    } catch(JsonException ex) {
        IOException e = new IOException();
        e.initCause(ex);
        throw e;
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:10,代码来源:DojoRendererUtil.java


示例7: generateJson

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
/**
 * Generate a JSON object.
 */
protected void generateJson(StringBuilder b, JsonJavaObject o) {
    try {
        JsonGenerator.toJson(JsonJavaFactory.instance, b, o, true);
    } catch(Exception e) {
        throw new FacesExceptionEx(e,"Exception while generating JSON attributes"); // $NLX-AbstractDojoClientAction.ExceptionwhilegeneratingJSONattri-1$
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:11,代码来源:AbstractDojoClientAction.java


示例8: createNumberConstraintsAsJson

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
public String createNumberConstraintsAsJson() {
    try {
        JsonJavaObject jo = new JsonJavaObject();
        double min = getMin();
        if(!Double.isNaN(min)) {
            jo.put("min", min); // $NON-NLS-1$
        }
        double max = getMax();
        if(!Double.isNaN(max)) {
            jo.put("max", max); // $NON-NLS-1$
        }
        // TODO convert Java locale code to Dojo locale code - see ViewRootRendererEx2.convertJavaLocaleToDojoLocale(String, boolean)
        Locale loc = getLocale();
        if( null != loc ){
            jo.putString("locale", loc); // $NON-NLS-1$
        }
        String pat = getPattern();
        if( null != pat ){
            jo.putString("pattern", pat); // $NON-NLS-1$
        }
        int places = getPlaces();
        if(places>=0) {
            jo.putInt("places", places); // $NON-NLS-1$
        }
        boolean severe = isStrict();
        if( false != severe ){
            jo.putBoolean("strict", severe); // $NON-NLS-1$
        }
        String ty = getType();
        if( null != ty ){
            jo.putString("type", ty); // $NON-NLS-1$
        }
        return jo.isEmpty() ? null : JsonGenerator.toJson(JsonJavaFactory.instance,jo,true);
    } catch(Exception e) {
        throw new FacesExceptionEx(e);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:38,代码来源:NumberConstraints.java


示例9: generateClientScript

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
public String generateClientScript() {
	FacesContext context = FacesContext.getCurrentInstance();
    StringBuilder b = new StringBuilder();
    // TabContainer.js has:
    // _removeTab: function(id,refreshId,params)
    b.append("dijit.byId("); // $NON-NLS-1$
    JavaScriptUtil.addString(b, container.getClientId(context));
    b.append(")._removeTab("); // $NON-NLS-1$
    JavaScriptUtil.addString(b, pane.getClientId(context));
    
    String rid=ExtLibUtil.getClientId(context,container,refreshId,true);
    if(StringUtil.isNotEmpty(rid)) {
        b.append(",");
        JavaScriptUtil.addString(b, rid);
        
        Object params = refreshParams;
        if(params!=null) {
            b.append(",{");
            try {
                String json = JsonGenerator.toJson(JsonJavaFactory.instance,params,true);
                b.append(json);
            } catch(Exception ex) {
                throw new FacesExceptionEx(ex);
            }
            b.append("}");
        }
    }
    b.append(");");

    if(b.length()>0) {
        String script = b.toString();
        return script;
    }
    
    return null;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:37,代码来源:UIDojoTabContainer.java


示例10: find

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
public DumpAccessor find(DumpContext dumpContext, Object o) {
    if(o instanceof FBSValue) {
        FBSValue v = (FBSValue)o;
        if(v.isNull()) {
            return new JSNull(dumpContext);
        }
        if(v.isUndefined()) {
            return new JSUndefined(dumpContext);
        }
        if(v.isPrimitive()) {
            return new JSPrimitive(dumpContext,v);
        }
        if(v.isArray()) {
            return new JSArray(dumpContext,v);
        }
        if(v.isObject()) {
            if(v instanceof JavaPackageObject) {
                // We ignore this one
                return new JavaDumpFactory.PrimitiveValue(dumpContext,v.getClass());
            }
            if(v.isJavaNative()) {
                try {
                    Object ov = v.toJavaObject();
                    return DumpAccessor.find(dumpContext,ov);
                } catch(InterpretException ex) {
                    return DumpAccessor.find(dumpContext,ex.toString());
                }
            }
            return new JSObject(dumpContext,getJSContext(),(FBSObject)v);
        }
    }
    if(o instanceof JSInterpreter) {
        // We ignore this one
        return new JavaDumpFactory.PrimitiveValue(dumpContext,o.getClass());
    }
    if(o instanceof JsonObject) {
        return new Json(dumpContext,JsonJavaFactory.instance,(JsonObject)o);
    }
    return null;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:41,代码来源:JavaScriptDumpFactory.java


示例11: fromJson

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
public MutedThreadUpdate fromJson() throws JsonException, ParseException, ModelException {
	final MutedThreadUpdate result = new MutedThreadUpdate();
	final JsonJavaObject obj = (JsonJavaObject) JsonParser.fromJson(JsonJavaFactory.instanceEx, _reader);

	for (final Entry<String, Object> entry : obj.entrySet()) {
		result.setRequestAction(entry.getKey(), validateUNID(entry.getValue()));
	}
	return result;

}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:11,代码来源:JsonMutedThreadUpdateParser.java


示例12: toString

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
public String toString() {
    try {
        return JsonGenerator.toJson(JsonJavaFactory.instance, this);
    } catch(Exception ex) {
        Platform.getInstance().log(ex);
        return "";
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:9,代码来源:JsonSortedObject.java


示例13: testParseObjectFromString

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
@Test
public void testParseObjectFromString() throws JsonException {
	JsonJavaFactory factory = JsonJavaFactory.instanceEx;
	JsonJavaObject json = (JsonJavaObject) JsonParser.fromJson(factory, RESULT);
	JsonBinderContainer container = new JsonBinderContainer();
	UserMock userMock = new UserMock();
	container.processJson2Object(json, userMock);
	assertNotNull(userMock);
	assertEquals("Marco Müller", userMock.getName());
	assertEquals(42, userMock.getAccountNumber());
	assertEquals(new Integer(42), userMock.getAccountObject());
	assertEquals(3, userMock.getTags().size());
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:14,代码来源:Json2ObjectTest.java


示例14: testParseObjectFromStringWithChildren

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
@Test
public void testParseObjectFromStringWithChildren() throws JsonException {
	JsonJavaFactory factory = JsonJavaFactory.instanceEx;
	JsonJavaObject json = (JsonJavaObject) JsonParser.fromJson(factory, RESULT_CHILDREND);
	JsonBinderContainer container = new JsonBinderContainer();
	UserMock userMock = new UserMock();
	container.processJson2Object(json, userMock);
	assertNotNull(userMock);
	assertEquals("Marco Müller", userMock.getName());
	assertEquals(42, userMock.getAccountNumber());
	assertEquals(new Integer(42), userMock.getAccountObject());
	assertEquals(3, userMock.getTags().size());
	assertEquals(2, userMock.getChildren().size());
	assertEquals("René Meier", userMock.getChildren().get(0).getName());
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:16,代码来源:Json2ObjectTest.java


示例15: processJson2Value

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
@Override
public void processJson2Value(BinderProcessParameter parameter) {
	JsonJavaFactory factory = JsonJavaFactory.instanceEx;
	IJSONBinder<?> innerBinder = DefinitionFactory.getJSONBinder(parameter.getJsonBinderContainer(), parameter.getContainerClass());
	try {
		Object arrDates = factory.getProperty(parameter.getJson(), parameter.getJsonProperty());
		List<?> values = buildValues(arrDates, innerBinder, parameter, factory);
		setValue(parameter.getObject(), parameter.getJavaField(), values, List.class);
	} catch (Exception ex) {
		ex.printStackTrace();
	}
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:13,代码来源:ListBinder.java


示例16: CouchbaseDocument

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
public CouchbaseDocument(final String connectionName, final String key) throws IOException, JsonException {
	connectionName_ = connectionName;
	key_ = key;

	CouchbaseClient client = getClient();
	// Assume it's always a document
	String json = (String) client.get(key_);
	data_ = (JsonJavaObject) JsonParser.fromJson(JsonJavaFactory.instanceEx, json);
}
 
开发者ID:jesse-gallagher,项目名称:Couchbase-Data-for-XPages,代码行数:10,代码来源:CouchbaseDocument.java


示例17: generateJavaScript

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
/**
 * 
 * @param context
 * @param dt
 * @param rowCount
 * @param state
 * @param linkId
 * @param computedDisabledFormat the result of a call to {@link #computeDisabledFormat(FacesContext, String, String)};
 * @return
 * @throws EvaluationException
 * @throws MethodNotFoundException
 */
public static String generateJavaScript(FacesContext context, FacesDataIterator dt, int rowCount, boolean state, String linkId,
        String computedDisabledFormat) throws EvaluationException, MethodNotFoundException {
    StringBuilder b = new StringBuilder(256);
    
    UIComponent c = (UIComponent)dt;
    
    // Add the dojo module
    ExtLibResources.addEncodeResource(context, ExtLibResources.extlibDataIterator);
    
    // And generate the piece of script
    String id = (c instanceof FacesDataIteratorAjax) ? ((FacesDataIteratorAjax)c).getAjaxContainerClientId(context) : c.getClientId(context);
    String url = AjaxUtil.getAjaxUrl(context, c, UIDataEx.AJAX_GETROWS, c.getClientId(context));
    url = context.getExternalContext().encodeActionURL(url);

    int first = dt.getFirst()+dt.getRows();
    int count = rowCount;
    if(count<=0) {
        // For SPR#MKEE8MHELJ, default to 30 rows
        // instead of to dt.getRows(), to prevent duplicating
        // the number of rows displayed on every click.
        count = UIDataEx.DEFAULT_ROWS_PER_PAGE;
    }
    
    // partial workaround for SPR#LHEY8LNDZS, problem in the xpage runtime.
    // The UIDataEx and UIDataIterator classes can't handle it when 
    // the number of rows to be added is < the rows property - they 
    // return too few rows. The client-side XSP.appendRows method 
    // thinks that, since too few rows are present, all the rows 
    // in the data set have been displayed, so it removes
    // the "Show more" link, even though not all rows have been shown.
    count = Math.min(count, dt.getRows());
    
    try {
        b.append("XSP.appendRows("); //$NON-NLS-1$
        JsonJavaObject jo = new JsonJavaObject();
        jo.putString("id", id); //$NON-NLS-1$
        jo.putString("url", url); //$NON-NLS-1$
        jo.putInt("first", first); //$NON-NLS-1$
        jo.putInt("count", count); //$NON-NLS-1$
        jo.putBoolean("state", state); //$NON-NLS-1$
        if( null != linkId ){
            jo.putString("linkId", linkId); //$NON-NLS-1$
            
            if( !DISABLED_FORMAT_TEXT.equals(computedDisabledFormat) ){
                jo.putString("linkDisabledFormat", computedDisabledFormat); //$NON-NLS-1$
            }
        }
        JsonGenerator.toJson(JsonJavaFactory.instance,b,jo,true);
        b.append(");"); //$NON-NLS-1$
    } catch(Exception e) {
        throw new FacesExceptionEx(e);
    }
    
    return b.toString();
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:68,代码来源:DataIteratorAddRows.java


示例18: createCurrencyConstraintsAsJson

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
public String createCurrencyConstraintsAsJson() {
    try {
        JsonJavaObject jo = new JsonJavaObject();
        double min = getMin();
        if(!Double.isNaN(min)) {
            jo.put("min", min); // $NON-NLS-1$
        }
        double max = getMax();
        if(!Double.isNaN(max)) {
            jo.put("max", max); // $NON-NLS-1$
        }
        String curr = getCurrency();
        if( null != curr ){
            jo.putString("currency", curr); // $NON-NLS-1$
        }
        String fra = getFractional();
        if( null != fra ){
            // SPR#JKAE9LEB6L was writing "false" instead of false (incorrectly quoted).
            // Acceptable values are either "enable", "disable", "auto", "true", or "false"
            // and the currency constraints allows "optional" or "[true, false]"
            // and historically we allow any other string value to also be added.
            if( "true".equals(fra) || "enable".equals(fra) ){ //$NON-NLS-1$ //$NON-NLS-2$
                jo.putBoolean("fractional", true); // $NON-NLS-1$
            }else if( "false".equals(fra) || "disable".equals(fra) ){//$NON-NLS-1$ //$NON-NLS-2$
                jo.putBoolean("fractional", false); // $NON-NLS-1$
            }else if( "auto".equals(fra) ){ //$NON-NLS-1$
                // don't render any output
            }else if("optional".equals(fra) || "[true, false]".equals(fra) //$NON-NLS-1$ //$NON-NLS-2$ 
                        || "[true,false]".equals(fra) ){ //$NON-NLS-1$
                // constraints: { fractional:[true, false] }
                JsonJavaArray arr = new JsonJavaArray();
                arr.putBoolean(0, true);
                arr.putBoolean(1, false);
                jo.putArray("fractional", arr); //$NON-NLS-1$
            }
            else{
                // else treat it like a string.
                jo.putString("fractional", fra); // $NON-NLS-1$
            }
        }
        // TODO convert Java locale code to Dojo locale code - see ViewRootRendererEx2.convertJavaLocaleToDojoLocale(String, boolean)
        Locale loc = getLocale();
        if( null != loc ){
            jo.putString("locale", loc); // $NON-NLS-1$
        }
        String pat = getPattern();
        if( null != pat ){
            jo.putString("pattern", pat); // $NON-NLS-1$
        }
        int places = getPlaces();
        if(places>=0) {
            jo.putInt("places", places); // $NON-NLS-1$
        }
        boolean severe = isStrict();
        if( false != severe ){
            jo.putBoolean("strict", severe); // $NON-NLS-1$
        }
        String sym = getSymbol();
        if( null != sym ){
            jo.putString("symbol", sym); // $NON-NLS-1$
        }
        String ty = getType();
        if( null != ty ){
            jo.putString("type", ty); // $NON-NLS-1$
        }
        return jo.isEmpty() ? null : JsonGenerator.toJson(JsonJavaFactory.instance,jo,true);
    } catch(Exception e) {
        throw new FacesExceptionEx(e);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:71,代码来源:NumberConstraints.java


示例19: createDateConstraintsAsJson

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
public String createDateConstraintsAsJson() {
    try {
        JsonJavaObject jo = new JsonJavaObject();
        String clickInc = getClickableIncrement();
        if( null != clickInc ){
            jo.putString("clickableIncrement", clickInc); // $NON-NLS-1$
        }
        String dp = getDatePattern();
        if( null != dp ){
            jo.putString("datePattern", dp); // $NON-NLS-1$
        }
        String len = getFormatLength();
        if( null != len ){
            jo.putString("formatLength", len); // $NON-NLS-1$
        }
        // TODO convert Java locale code to Dojo locale code - see ViewRootRendererEx2.convertJavaLocaleToDojoLocale(String, boolean)
        Locale loc = getLocale();
        if( null != loc ){
            jo.putString("locale", loc); // $NON-NLS-1$
        }
        String sel = getSelector();
        if( null != sel ){
            jo.putString("selector", sel); // $NON-NLS-1$
        }
        boolean severe = isStrict();
        if( false != severe ){
            jo.putBoolean("strict", severe); // $NON-NLS-1$
        }
        String visInc = getVisibleIncrement();
        if( null != visInc ){
            jo.putString("visibleIncrement", visInc); // $NON-NLS-1$
        }
        String visRange = getVisibleRange();
        if( null != visRange ){
            jo.putString("visibleRange", visRange); // $NON-NLS-1$
        }
        return jo.isEmpty() ? null : JsonGenerator.toJson(JsonJavaFactory.instance,jo,true);
    } catch(Exception e) {
        throw new FacesExceptionEx(e);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:42,代码来源:DateTimeConstraints.java


示例20: createTimeConstraintsAsJson

import com.ibm.commons.util.io.json.JsonJavaFactory; //导入依赖的package包/类
public String createTimeConstraintsAsJson() {
    try {
        JsonJavaObject jo = new JsonJavaObject();
        String a = getAm();
        if( null != a ){
        jo.putString("am", a); // $NON-NLS-1$
        }
        String p = getPm();
        if( null != p ){
            jo.putString("pm", p); // $NON-NLS-1$
        }
        String clickInc = getClickableIncrement();
        if( null != clickInc ){
            jo.putString("clickableIncrement", clickInc); // $NON-NLS-1$
        }
        String tp = getTimePattern();
        if( null != tp ){
            jo.putString("timePattern", tp); // $NON-NLS-1$
        }
        String len = getFormatLength();
        if( null != len ){
            jo.putString("formatLength", len); // $NON-NLS-1$
        }
        // TODO convert Java locale code to Dojo locale code - see ViewRootRendererEx2.convertJavaLocaleToDojoLocale(String, boolean)
        Locale loc = getLocale();
        if( null != loc ){
            jo.putString("locale", loc); // $NON-NLS-1$
        }
        String sel = getSelector();
        if( null != sel ){
            jo.putString("selector", sel); // $NON-NLS-1$
        }
        boolean severe = isStrict();
        if( false != severe ){
            jo.putBoolean("strict", severe); // $NON-NLS-1$
        }
        String visInc = getVisibleIncrement();
        if( null != visInc ){
            jo.putString("visibleIncrement", visInc); // $NON-NLS-1$
        }
        String visRange = getVisibleRange();
        if( null != visRange ){
            jo.putString("visibleRange", visRange); // $NON-NLS-1$
        }
        return jo.isEmpty() ? null : JsonGenerator.toJson(JsonJavaFactory.instance,jo,true);
    } catch(Exception e) {
        throw new FacesExceptionEx(e);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:50,代码来源:DateTimeConstraints.java



注:本文中的com.ibm.commons.util.io.json.JsonJavaFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ExceptionWorldConflict类代码示例发布时间:2022-05-23
下一篇:
Java QueryParseException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap