當前位置: 首頁>>代碼示例>>Java>>正文


Java JsonObject.fieldNames方法代碼示例

本文整理匯總了Java中io.vertx.core.json.JsonObject.fieldNames方法的典型用法代碼示例。如果您正苦於以下問題:Java JsonObject.fieldNames方法的具體用法?Java JsonObject.fieldNames怎麽用?Java JsonObject.fieldNames使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在io.vertx.core.json.JsonObject的用法示例。


在下文中一共展示了JsonObject.fieldNames方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: scan

import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
@Override
public Set<Cliff> scan(final Set<Class<?>> walls) {
    /** 1. Build result **/
    final Set<Cliff> wallSet = new TreeSet<>();
    final Set<Class<?>> wallClses = walls.stream()
            .filter((item) -> item.isAnnotationPresent(Wall.class))
            .collect(Collectors.toSet());
    if (!wallClses.isEmpty()) {
        /**
         * It means that you have set Wall and enable security configuration
         * wallClses verification
         */
        final ConcurrentMap<String, Class<?>> keys = new ConcurrentHashMap<>();
        final JsonObject config = this.verify(wallClses, keys);
        for (final String field : config.fieldNames()) {
            // Difference key setting
            final Class<?> cls = keys.get(field);
            final Cliff cliff = this.transformer.transform(config.getJsonObject(field));
            // Set Information from class
            mountData(cliff, cls);
            wallSet.add(cliff);
        }
    }
    /** 3. Transfer **/
    return wallSet;
}
 
開發者ID:silentbalanceyh,項目名稱:vertx-zero,代碼行數:27,代碼來源:WallInquirer.java

示例2: setDataBase

import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
private void setDataBase(JsonObject data){

        for(String key:data.fieldNames()){
            if(data.getValue(key)==null) continue;
            if(data.getValue(key) instanceof Number){
                pieChartData.add(new javafx.scene.chart.PieChart.Data(key, ((Number)data.getValue(key)).doubleValue()));
            }else{
                try{
                    double value = Double.parseDouble(data.getValue(key).toString());
                    pieChartData.add(new javafx.scene.chart.PieChart.Data(key, value));
                }catch (Exception e){
                    //do nothing
                }
            }
        }

        ((javafx.scene.chart.PieChart)body).setData(pieChartData);
    }
 
開發者ID:whitewoodcity,項目名稱:xbrowser,代碼行數:19,代碼來源:PieChart.java

示例3: build

import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
private static Envelop build(final JsonObject json) {
    Envelop envelop = Envelop.ok();
    // 1. Headers
    if (null != json) {
        // 2.Rebuild
        if (json.containsKey("data")) {
            envelop = Envelop.success(json.getValue("data"));
        }
        // 3.Header
        if (null != json.getValue("header")) {
            final MultiMap headers = MultiMap.caseInsensitiveMultiMap();
            final JsonObject headerData = json.getJsonObject("header");
            for (final String key : headerData.fieldNames()) {
                final Object value = headerData.getValue(key);
                if (null != value) {
                    headers.set(key, value.toString());
                }
            }
            envelop.setHeaders(headers);
        }
        // 4.User
        if (null != json.getValue("user")) {
            envelop.setUser(new VirtualUser(json.getJsonObject("user")));
        }
    }
    return envelop;
}
 
開發者ID:silentbalanceyh,項目名稱:vertx-zero,代碼行數:28,代碼來源:DataEncap.java

示例4: json

import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
public JsonObject json(final Object entity, final boolean overwrite) {
    final JsonObject data = Jackson.serializeJson(entity);
    final JsonObject merged = this.converted.copy();
    for (final String field : data.fieldNames()) {
        if (overwrite) {
            // If overwrite
            merged.put(field, data.getValue(field));
        } else {
            if (!merged.containsKey(field)) {
                merged.put(field, data.getValue(field));
            }
        }
    }
    return merged;
}
 
開發者ID:silentbalanceyh,項目名稱:vertx-zero,代碼行數:16,代碼來源:Mirror.java

示例5: execZero

import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
static <T> void execZero(final JsonObject data,
                         final ZeroBiConsumer<T, String> fnIt)
        throws ZeroException {
    for (final String name : data.fieldNames()) {
        final Object item = data.getValue(name);
        if (null != item) {
            fnIt.accept((T) item, name);
        }
    }
}
 
開發者ID:silentbalanceyh,項目名稱:vertx-zero,代碼行數:11,代碼來源:Congregation.java

示例6: setSeries

import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
private void setSeries(String name, JsonArray jsonArray){

        javafx.scene.chart.XYChart.Series series = new javafx.scene.chart.XYChart.Series();
        series.setName(name);
        if(xScale == null) return;
        for(int i=0;i<xScale.size();i++){
            if(i<jsonArray.size()&&jsonArray.getValue(i)!=null) {
                Object x = xScale.getValue(i);
                if(xAxis instanceof CategoryAxis)
                    x = x.toString();

                Object y = jsonArray.getValue(i);
                if(y == null){

                }else if(y instanceof Number)
                    addData(series,x,y);
                else if(y instanceof JsonObject){
                    Object xx=null, yy=null, extra=null;
                    JsonObject jsonObject = (JsonObject)y;
                    for(String key:jsonObject.fieldNames()){
                        if(key.equals("x")) xx = jsonObject.getValue(key);
                        else if(key.equals("y")) yy = jsonObject.getValue(key);
                        else extra = jsonObject.getValue(key);
                    }

                    if(xx!=null&&yy!=null){
                        if(extra!=null) addData(series,xx,yy,extra);
                        else addData(series,xx,yy);
                    }
                }
                else
                    addData(series,x,y);
            }
        }
        ((javafx.scene.chart.XYChart)body).getData().add(series);
    }
 
開發者ID:whitewoodcity,項目名稱:xbrowser,代碼行數:37,代碼來源:XYChart.java

示例7: setDataBase

import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
private void setDataBase(JsonObject jsonObject){
    for(String name:jsonObject.fieldNames()){
        if(jsonObject.getValue(name)!=null && jsonObject.getValue(name) instanceof JsonArray){
            setSeries(name, jsonObject.getJsonArray(name));
        }
    }
}
 
開發者ID:whitewoodcity,項目名稱:xbrowser,代碼行數:8,代碼來源:XYChart.java

示例8: factoryConfig

import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
/**
 * Setup remote deployment related configuration such as maven settings
 */
private void factoryConfig() {
	JsonObject proxyObj = BaseUtil.proxyFromSystemProps();
	ResolverOptions resolverOptions = new ResolverOptions();

	if (proxyObj.containsKey("httpProxyURL")) {
		resolverOptions.setHttpProxy(proxyObj.getString("httpProxyURL"));
	}

	if (proxyObj.containsKey("httpsProxyURL")) {
		resolverOptions.setHttpsProxy(proxyObj.getString("httpsProxyURL"));
	}

	if (this.deployConfig.containsKey("maven")) {
		JsonObject mvnOpts = this.deployConfig.getJsonObject("maven");
		Set<String> optKeys = mvnOpts.fieldNames();
		Iterator<String> optIter = optKeys.iterator();
		String optKey;

		while (optIter.hasNext()) {
			optKey = optIter.next();

			switch (optKey) {
				case "localRepo":
					resolverOptions.setLocalRepository(mvnOpts.getString(optKey));
					break;
				case "remoteRepos":
					List<String> remoteRepoList = BaseUtil.jsonArrayToList(mvnOpts.getJsonArray(optKey), String.class);
					resolverOptions.setRemoteRepositories(remoteRepoList);
					break;
				case "snapshotRefresh":
					resolverOptions.setRemoteSnapshotPolicy(mvnOpts.getString(optKey));
					break;
				default:
					break;
			}
		}
	}

	// Language specific factories
	this.vertx.registerVerticleFactory(new JSVerticleFactory());
	this.vertx.registerVerticleFactory(new GroovyVerticleFactory());
	this.vertx.registerVerticleFactory(new JRubyVerticleFactory());
	this.vertx.registerVerticleFactory(new ScalaVerticleFactory());
	this.vertx.registerVerticleFactory(new KotlinVerticleFactory());
	this.vertx.registerVerticleFactory(new KotlinScriptVerticleFactory());
	this.vertx.registerVerticleFactory(new CeylonVerticleFactory());

	// Service factories
	this.vertx.registerVerticleFactory(new ServiceVerticleFactory());
	this.vertx.registerVerticleFactory(new HttpServiceFactory());
	this.vertx.registerVerticleFactory(new HttpSecureServiceFactory());
	this.vertx.registerVerticleFactory(new MavenVerticleFactory(resolverOptions));
}
 
開發者ID:mustertech,項目名稱:rms-deployer,代碼行數:57,代碼來源:VtxDeployer.java


注:本文中的io.vertx.core.json.JsonObject.fieldNames方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。