Code example for Node

Methods: getAttributes, hasAttributes

0
@SuppressWarnings("restriction") 
public abstract class AbstractAspectDefinitionBuilder implements IAspectDefinitionBuilder { 
 
	protected String getAttribute(Node node, String attributeName) {
		if (hasAttribute(node, attributeName)) {
			String value = node.getAttributes().getNamedItem(attributeName).getNodeValue();
			value = StringUtils.replace(value, "\n", " ");
			value = StringUtils.replace(value, "\t", " ");
			return StringUtils.replace(value, "\r", " ");
		} 
		return null; 
	} 
 
	protected boolean hasAttribute(Node node, String attributeName) {
		return (node != null && node.hasAttributes() && node.getAttributes().getNamedItem(
				attributeName) != null);
	} 
	 
	protected void extractLineNumbers(IAspectDefinition def, IDOMNode node) {
		if (def instanceof BeanAspectDefinition) {
			BeanAspectDefinition bDef = (BeanAspectDefinition) def;