本文整理汇总了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 //
);
}
示例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);
}
示例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;
}
示例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;
}