Methods Summary |
---|
public void | addDisable(org.apache.tools.ant.types.Assertions$DisabledAssertion assertion)disable assertions
checkChildrenAllowed();
assertionList.add(assertion);
|
public void | addEnable(org.apache.tools.ant.types.Assertions$EnabledAssertion assertion)enable assertions
checkChildrenAllowed();
assertionList.add(assertion);
|
private static void | addVmArgument(CommandlineJava command, java.lang.String arg)helper method to add a string JVM argument to a command
Commandline.Argument argument;
argument = command.createVmArgument();
argument.setValue(arg);
|
public void | applyAssertions(java.util.ListIterator commandIterator)add the assertions to a list in a format suitable
for adding to a command line
getProject().log("Applying assertions", Project.MSG_DEBUG);
Assertions clause = getFinalReference();
//do the system assertions
if (Boolean.TRUE.equals(clause.enableSystemAssertions)) {
getProject().log("Enabling system assertions", Project.MSG_DEBUG);
commandIterator.add("-enablesystemassertions");
} else if (Boolean.FALSE.equals(clause.enableSystemAssertions)) {
getProject().log("disabling system assertions", Project.MSG_DEBUG);
commandIterator.add("-disablesystemassertions");
}
//now any inner assertions
Iterator it = clause.assertionList.iterator();
while (it.hasNext()) {
BaseAssertion assertion = (BaseAssertion) it.next();
String arg = assertion.toCommand();
getProject().log("adding assertion " + arg, Project.MSG_DEBUG);
commandIterator.add(arg);
}
|
public void | applyAssertions(java.util.List commandList)add the assertions to a list in a format suitable
for adding to a command line
getProject().log("Applying assertions", Project.MSG_DEBUG);
Assertions clause = getFinalReference();
//do the system assertions
if (Boolean.TRUE.equals(clause.enableSystemAssertions)) {
getProject().log("Enabling system assertions", Project.MSG_DEBUG);
commandList.add("-enablesystemassertions");
} else if (Boolean.FALSE.equals(clause.enableSystemAssertions)) {
getProject().log("disabling system assertions", Project.MSG_DEBUG);
commandList.add("-disablesystemassertions");
}
//now any inner assertions
Iterator it = clause.assertionList.iterator();
while (it.hasNext()) {
BaseAssertion assertion = (BaseAssertion) it.next();
String arg = assertion.toCommand();
getProject().log("adding assertion " + arg, Project.MSG_DEBUG);
commandList.add(arg);
}
|
public void | applyAssertions(CommandlineJava command)apply all the assertions to the command.
Assertions clause = getFinalReference();
//do the system assertions
if (Boolean.TRUE.equals(clause.enableSystemAssertions)) {
addVmArgument(command, "-enablesystemassertions");
} else if (Boolean.FALSE.equals(clause.enableSystemAssertions)) {
addVmArgument(command, "-disablesystemassertions");
}
//now any inner assertions
Iterator it = clause.assertionList.iterator();
while (it.hasNext()) {
BaseAssertion assertion = (BaseAssertion) it.next();
String arg = assertion.toCommand();
addVmArgument(command, arg);
}
|
public java.lang.Object | clone()clone the objects.
This is not a full depth clone; the list of assertions is cloned,
but it does not clone the underlying assertions.
Assertions that = (Assertions) super.clone();
that.assertionList = (ArrayList) assertionList.clone();
return that;
|
private org.apache.tools.ant.types.Assertions | getFinalReference()get whatever we are referencing to. This could be ourself.
if (getRefid() == null) {
return this;
} else {
Object o = getRefid().getReferencedObject(getProject());
if (!(o instanceof Assertions)) {
throw new BuildException("reference is of wrong type");
}
return (Assertions) o;
}
|
private int | getFinalSize()what is the final size of this object
return assertionList.size() + (enableSystemAssertions != null ? 1 : 0);
|
public void | setEnableSystemAssertions(java.lang.Boolean enableSystemAssertions)enable or disable system assertions.
Default is not set (neither -enablesystemassersions or -disablesytemassertions
are used on the command line).
checkAttributesAllowed();
this.enableSystemAssertions = enableSystemAssertions;
|
public void | setRefid(Reference ref)Set the value of the refid attribute.
Subclasses may need to check whether any other attributes
have been set as well or child elements have been created and
thus override this method. if they do the must call
super.setRefid .
if (assertionList.size() > 0 || enableSystemAssertions != null) {
throw tooManyAttributes();
}
super.setRefid(ref);
|
public int | size()how many assertions are made...will resolve references before returning
Assertions clause = getFinalReference();
return clause.getFinalSize();
|