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


Java ElementKind.METHOD属性代码示例

本文整理汇总了Java中javax.validation.ElementKind.METHOD属性的典型用法代码示例。如果您正苦于以下问题:Java ElementKind.METHOD属性的具体用法?Java ElementKind.METHOD怎么用?Java ElementKind.METHOD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.validation.ElementKind的用法示例。


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

示例1: createMethodNode

/**
 * create method node.
 *
 * @param name name of the node
 * @param parent parent node
 * @param parameterTypes parameter types
 * @return new node implementation
 */
public static NodeImpl createMethodNode(final String name, final NodeImpl parent,
    final Class<?>[] parameterTypes) {
  return new NodeImpl( //
      name, //
      parent, //
      false, //
      null, //
      null, //
      ElementKind.METHOD, //
      parameterTypes, //
      null, //
      null, //
      null, //
      null //
  );
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:24,代码来源:NodeImpl.java

示例2: as

@SuppressWarnings("unchecked")
@Override
public <T extends Path.Node> T as(final Class<T> nodeType) throws ClassCastException { // NOPMD
  if (this.kind == ElementKind.BEAN && nodeType == BeanNode.class
      || this.kind == ElementKind.CONSTRUCTOR && nodeType == ConstructorNode.class
      || this.kind == ElementKind.CROSS_PARAMETER && nodeType == CrossParameterNode.class
      || this.kind == ElementKind.METHOD && nodeType == MethodNode.class
      || this.kind == ElementKind.PARAMETER && nodeType == ParameterNode.class
      || this.kind == ElementKind.PROPERTY && (nodeType == PropertyNode.class
          || nodeType == org.hibernate.validator.path.PropertyNode.class)
      || this.kind == ElementKind.RETURN_VALUE && nodeType == ReturnValueNode.class
      || this.kind == ElementKind.CONTAINER_ELEMENT && (nodeType == ContainerElementNode.class
          || nodeType == org.hibernate.validator.path.ContainerElementNode.class)) {
    return (T) this;
  }

  throw LOG.getUnableToNarrowNodeTypeException(this.getClass(), this.kind, nodeType);
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:18,代码来源:NodeImpl.java

示例3: resolvePath

/**
 * Translate validated bean and root path into validated resource and
 * resource path. For example, embeddables belonging to an entity document
 * are mapped back to an entity violation and a proper path to the
 * embeddable attribute.
 *
 * @param violation to compute the reference
 * @return computaed reference
 */
private ResourceRef resolvePath(ConstraintViolation<?> violation) {
	Object resource = violation.getRootBean();

	Object nodeObject = resource;
	ResourceRef ref = new ResourceRef(resource);

	Iterator<Node> iterator = violation.getPropertyPath().iterator();
	while (iterator.hasNext()) {
		Node node = iterator.next();

		// ignore methods/parameters
		if (node.getKind() == ElementKind.METHOD) {
			continue;
		}
		if (node.getKind() == ElementKind.PARAMETER) {
			resource = getParameterValue(node);
			nodeObject = resource;
			ref = new ResourceRef(resource);
			assertResource(resource);
			continue;
		}

		// visit list, set, map references
		nodeObject = ref.getNodeReference(nodeObject, node);
		ref.visitNode(nodeObject);

		// visit property
		nodeObject = ref.visitProperty(nodeObject, node);
	}

	return ref;
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:41,代码来源:ConstraintViolationExceptionMapper.java

示例4: getConstrainedMethodsAsDescriptors

private Map<String, ExecutableDescriptorImpl> getConstrainedMethodsAsDescriptors() {
	Map<String, ExecutableDescriptorImpl> constrainedMethodDescriptors = newHashMap();

	for (ExecutableMetaData executableMetaData : executableMetaDataMap.values()) {
		if (executableMetaData.getKind() == ElementKind.METHOD && executableMetaData.isConstrained()) {
			constrainedMethodDescriptors.put(executableMetaData.getIdentifier(), executableMetaData.asDescriptor(
					defaultGroupSequenceIsRedefined(), getDefaultGroupSequence(null)));
		}
	}

	return constrainedMethodDescriptors;
}
 
开发者ID:bradwoo8621,项目名称:nest-old,代码行数:12,代码来源:BeanMetaDataImpl513.java


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