Browse Source

refactoring out something that I see in too, too many places in datatypes

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274666 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 22 years ago
parent
commit
0ad112c8f7
1 changed files with 26 additions and 0 deletions
  1. +26
    -0
      src/main/org/apache/tools/ant/types/DataType.java

+ 26
- 0
src/main/org/apache/tools/ant/types/DataType.java View File

@@ -232,8 +232,34 @@ public abstract class DataType extends ProjectComponent {
this.checked = checked;
}

/**
* get the reference set on this object
* @return the reference or null
*/
protected Reference getRefid()
{
return ref;
}

/**
* check that it is ok to set attributes, i.e that no reference is defined
* @since Ant 1.6
* @throw BuildException if not allowed
*/
protected void checkAttributesAllowed() {
if (isReference()) {
throw tooManyAttributes();
}
}

/**
* check that it is ok to add children, i.e that no reference is defined
* @since Ant 1.6
* @throw BuildException if not allowed
*/
protected void checkChildrenAllowed() {
if (isReference()) {
throw noChildrenAllowed();
}
}
}

Loading…
Cancel
Save