本文整理汇总了Java中com.sun.codemodel.internal.JAnnotationArrayMember类的典型用法代码示例。如果您正苦于以下问题:Java JAnnotationArrayMember类的具体用法?Java JAnnotationArrayMember怎么用?Java JAnnotationArrayMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JAnnotationArrayMember类属于com.sun.codemodel.internal包,在下文中一共展示了JAnnotationArrayMember类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeXmlTypeDeclaration
import com.sun.codemodel.internal.JAnnotationArrayMember; //导入依赖的package包/类
private void writeXmlTypeDeclaration(JDefinedClass cls, String typeName, String namespaceUri,
Collection<MemberInfo> members) {
if (cls == null)
return;
JAnnotationUse xmlTypeAnn = cls.annotate(cm.ref(XmlType.class));
xmlTypeAnn.param("name", typeName);
xmlTypeAnn.param("namespace", namespaceUri);
if (members.size() > 1) {
JAnnotationArrayMember paramArray = xmlTypeAnn.paramArray("propOrder");
for (MemberInfo memInfo : members) {
paramArray.param(memInfo.getParamName());
}
}
}
示例2: writeMethodAnnotations
import com.sun.codemodel.internal.JAnnotationArrayMember; //导入依赖的package包/类
@Override
public void writeMethodAnnotations(TWSDLOperation two, JMethod jMethod) {
JAnnotationUse actionAnn = null;
if (!(two instanceof Operation))
return;
Operation o = ((Operation)two);
// explicit input action
if (o.getInput().getAction() != null && !o.getInput().getAction().equals("")) {
// explicitly specified
actionAnn = jMethod.annotate(Action.class);
actionAnn.param("input", o.getInput().getAction());
}
// explicit output action
if (o.getOutput() != null && o.getOutput().getAction() != null && !o.getOutput().getAction().equals("")) {
// explicitly specified
if (actionAnn == null)
actionAnn = jMethod.annotate(Action.class);
actionAnn.param("output", o.getOutput().getAction());
}
// explicit fault action
if (o.getFaults() != null && o.getFaults().size() > 0) {
Map<String, JClass> map = o.getFaults();
JAnnotationArrayMember jam = null;
for (Fault f : o.faults()) {
if (f.getAction() == null)
continue;
if (f.getAction().equals(""))
continue;
if (actionAnn == null) {
actionAnn = jMethod.annotate(Action.class);
}
if (jam == null) {
jam = actionAnn.paramArray("fault");
}
final JAnnotationUse faAnn = jam.annotate(FaultAction.class);
faAnn.param("className", map.get(f.getName()));
faAnn.param("value", f.getAction());
}
}
}