Methods Summary |
---|
public void | addConfiguredProvider(Provider provider)Add a nested provider element.
provider.check();
providerList.add(provider);
|
public void | check()Check if this object is configured correctly as a nested
element.
if (type == null) {
throw new BuildException(
"type attribute must be set for service element",
getLocation());
}
if (type.length() == 0) {
throw new BuildException(
"Invalid empty type classname", getLocation());
}
if (providerList.size() == 0) {
throw new BuildException(
"provider attribute or nested provider element must be set!",
getLocation());
}
|
public java.io.InputStream | getAsStream()Return the implementations of this
services as an inputstream.
ByteArrayOutputStream arrayOut;
Writer writer;
Iterator providerIterator;
Provider provider;
arrayOut = new ByteArrayOutputStream();
writer = new OutputStreamWriter(arrayOut, "UTF-8");
providerIterator = providerList.iterator();
while (providerIterator.hasNext()) {
provider = (Provider) providerIterator.next();
writer.write(provider.getClassName());
writer.write("\n");
}
writer.close();
return new ByteArrayInputStream(arrayOut.toByteArray());
|
public java.lang.String | getType()
return type;
|
public void | setProvider(java.lang.String className)Set the provider classname.
Provider provider = new Provider();
provider.setClassName(className);
providerList.add(provider);
|
public void | setType(java.lang.String type)Set the service type.
this.type = type;
|