org.eclipse.jdt.core.dom.StructuralPropertyDescriptor#getId ( )源码实例Demo

下面列出了org.eclipse.jdt.core.dom.StructuralPropertyDescriptor#getId ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

private void validateIsListProperty(StructuralPropertyDescriptor property) {
	if (!property.isChildListProperty()) {
		String message= property.getId() + " is not a list property"; //$NON-NLS-1$
		throw new IllegalArgumentException(message);
	}
}
 
private void validateHasChildProperty(ASTNode parent, StructuralPropertyDescriptor property) {
	if (!parent.structuralPropertiesForType().contains(property)) {
		String message= Signature.getSimpleName(parent.getClass().getName()) + " has no property " + property.getId(); //$NON-NLS-1$
		throw new IllegalArgumentException(message);
	}
}
 
private void validateIsNodeProperty(StructuralPropertyDescriptor property) {
	if (property.isChildListProperty()) {
		String message= property.getId() + " is not a node property"; //$NON-NLS-1$
		throw new IllegalArgumentException(message);
	}
}
 
private void validateIsListProperty(StructuralPropertyDescriptor property) {
	if (!property.isChildListProperty()) {
		String message= property.getId() + " is not a list property"; //$NON-NLS-1$
		throw new IllegalArgumentException(message);
	}
}
 
private void validateIsPropertyOfNode(StructuralPropertyDescriptor property, ASTNode node) {
	if (!property.getNodeClass().isInstance(node)) {
		String message= property.getId() + " is not a property of type " + node.getClass().getName(); //$NON-NLS-1$
		throw new IllegalArgumentException(message);
	}
}