当前位置: 首页>>代码示例>>Java>>正文


Java Bind类代码示例

本文整理汇总了Java中org.dynamicloud.api.annotation.Bind的典型用法代码示例。如果您正苦于以下问题:Java Bind类的具体用法?Java Bind怎么用?Java Bind使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Bind类属于org.dynamicloud.api.annotation包,在下文中一共展示了Bind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMethod

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
/**
 * This method will find a declared method with annotation Bind.
 * If this method did not find a method then will return null
 *
 * @param r      object to use and find the specific method
 * @param target bound string to find method.
 * @return the specific method.
 */
private static Method getMethod(Object r, String target) {
    Method[] methods = r.getClass().getMethods();
    for (Method m : methods) {
        Bind bind = m.getAnnotation(Bind.class);
        if (bind != null && bind.field().equals(target)) {
            return m;
        }
    }

    return null;
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:20,代码来源:DynamiCloudUtil.java

示例2: buildFieldsJSON

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
/**
 * Builds a compatible string to update a record.
 * This method will find the Bind annotation to get field name and its value form bound object.
 *
 * @param instance Object where data is extracted
 * @return compatible string
 */
public static String buildFieldsJSON(BoundInstance instance) {
    JSONObject json = new JSONObject();

    Method[] methods = instance.getClass().getMethods();
    for (Method m : methods) {
        Bind a = m.getAnnotation(Bind.class);
        if (a != null) {
            String fieldName = a.field();
            String methodName = GET + m.getName().replaceAll(SET, StringUtils.EMPTY);

            try {
                Method getMethod = instance.getClass().getMethod(methodName);
                Object result = getMethod.invoke(instance);
                if (result instanceof Object[]) {
                    String array = "";
                    for (Object o : (Object[]) result) {
                        if (o != null) {
                            array += (array.length() == 0 ? "" : ",") + o.toString();
                        }
                    }

                    json.put(fieldName, array);
                } else if (result instanceof Date) {
                    json.put(fieldName, df.format((Date) result));
                } else if (result != null) {
                    json.put(fieldName, result.toString());
                }
            } catch (Exception e) {
                logger.warn(e.getMessage());
            }
        }
    }

    return json.toString();
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:43,代码来源:DynamiCloudUtil.java

示例3: setCount

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
/**
 * Sets the count of a query.  This method is a helper to fetch the count of logs in Dynamicloud
 * @param count count of logs
 */
@Bind(field = "count")
final public void setCount(Long count) {
    this.count = count;
}
 
开发者ID:egomezr,项目名称:lonline_for_java,代码行数:9,代码来源:LonlineLog.java

示例4: setWhen

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
/**
 * Sets the time when a log was created.
 * @param when date time
 */
@Bind(field = "added_at")
public final void setWhen(Date when) {
    this.when = when;
}
 
开发者ID:egomezr,项目名称:lonline_for_java,代码行数:9,代码来源:LonlineLog.java

示例5: setFinancialModule

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
@Bind(field = "lonlinemodule")
public void setFinancialModule(String module) {
    this.financialModule = module;
}
 
开发者ID:egomezr,项目名称:lonline_for_java,代码行数:5,代码来源:AdditionalInformation.java

示例6: setRecordId

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
/**
 * Sets a new record id
 *
 * @param newRid new record id
 */
@Override
@Bind(field = "rid")
public void setRecordId(Number newRid) {
    this.id = newRid.longValue();
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:11,代码来源:DateBean.java

示例7: setDate

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
@Bind(field = "datefie")
public void setDate(Date date) {
    this.date = date;
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:5,代码来源:DateBean.java

示例8: setRecordId

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
@Override
@Bind(field = "rid")
public void setRecordId(Number newRid) {
    this.rid = newRid;
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:6,代码来源:ModelFields.java

示例9: setUsername

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
@Bind(field = "username")
public void setUsername(String username) {
    this.username = username;
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:5,代码来源:ModelFields.java

示例10: setPassword

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
@Bind(field = "password")
public void setPassword(String[] password) {
    this.password = password;
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:5,代码来源:ModelFields.java

示例11: setEmail

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
@Bind(field = "email")
public void setEmail(String email) {
    this.email = email;
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:5,代码来源:ModelFields.java

示例12: setCountry

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
@Bind(field = "country")
public void setCountry(String country) {
    this.country = country;
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:5,代码来源:ModelFields.java

示例13: setName

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
@Bind(field = "name")
public void setName(String name) {
    this.name = name;
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:5,代码来源:ModelFields.java

示例14: setBirthdat

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
@Bind(field = "birthdat")
public void setBirthdat(String birthdat) {
    this.birthdat = birthdat;
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:5,代码来源:ModelFields.java

示例15: setAuxiliarFile

import org.dynamicloud.api.annotation.Bind; //导入依赖的package包/类
@Bind(field = "fieldtwo")
public void setAuxiliarFile(String auxiliarFile) {
    this.auxiliarFile = auxiliarFile;
}
 
开发者ID:egomezr,项目名称:dynamicloud_java_api,代码行数:5,代码来源:ModelFields.java


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