Top Description Inners Fields Constructors Methods
org.apache.tools.ant.taskdefs

public Class AntStructure

extends Task
Class Inheritance
Imports
java.io.File, .IOException, .OutputStreamWriter, .PrintWriter, java.lang.reflect.InvocationTargetException, java.nio.charset.StandardCharsets, java.nio.file.Files, java.util.ArrayList, .Collections, .Hashtable, .List, .Set, java.util.stream.Collector, .Collectors, .Stream, org.apache.tools.ant.BuildException, .IntrospectionHelper, .Project, .Task, .TaskContainer, org.apache.tools.ant.types.EnumeratedAttribute, .Reference

Creates a partial DTD for Ant from the currently known tasks.
Since
Ant 1.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static interface
AntStructure.StructurePrinter

Writes the actual structure information.

Field Summary

Modifier and TypeField and Description
private File
private AntStructure.StructurePrinter
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(final AntStructure.StructurePrinter
the printer to use.
p
)

The StructurePrinter to use.

protected boolean

Returns:

true if all the strings in the array math XML-NMTOKEN
areNmtokens
(final String[]
the array of string to test
s
)

Do the Strings all match the XML-NMTOKEN production?

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Build the antstructure DTD.
protected boolean

Returns:

true if the string matches the XML-NMTOKEN
isNmtoken
(final String
the string to test
s
)

Does this String match the XML-NMTOKEN production?

public void
setOutput(final File
the output file
output
)

The output file.

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

outputback to summary
private File output
printerback to summary
private AntStructure.StructurePrinter printer

Constructor Detail

AntStructureback to summary
public AntStructure()

Method Detail

addback to summary
public void add(final AntStructure.StructurePrinter p)

The StructurePrinter to use.

Parameters
p:AntStructure.StructurePrinter

the printer to use.

Since
Ant 1.7
areNmtokensback to summary
protected boolean areNmtokens(final String[] s)

Do the Strings all match the XML-NMTOKEN production?

Otherwise they are not suitable as an enumerated attribute, for example.

Parameters
s:String[]

the array of string to test

Returns:boolean

true if all the strings in the array math XML-NMTOKEN

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Build the antstructure DTD.

Annotations
@Override
Exceptions
BuildException:
if the DTD cannot be written.
isNmtokenback to summary
protected boolean isNmtoken(final String s)

Does this String match the XML-NMTOKEN production?

Parameters
s:String

the string to test

Returns:boolean

true if the string matches the XML-NMTOKEN

setOutputback to summary
public void setOutput(final File output)

The output file.

Parameters
output:File

the output file

org.apache.tools.ant.taskdefs back to summary

private Class AntStructure.DTDPrinter

extends Object
implements StructurePrinter
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final String
private final Hashtable<String, String>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static final boolean

Returns:

true if all the strings in the array math XML-NMTOKEN
areNmtokens
(final String[]
the array of string to test
s
)

Do the Strings all match the XML-NMTOKEN production?

public static final boolean

Returns:

true if the string matches the XML-NMTOKEN
isNmtoken
(final String
the string to test
s
)

Does this String match the XML-NMTOKEN production?

public void
printElementDecl(final PrintWriter
PrintWriter to write to.
out
,
final Project
Project instance for the current task
p
,
final String
element name.
name
,
final Class<?>
class of the defined element.
element
)

Implements org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printElementDecl.

Print the definition for a given element.
public void
printHead(final PrintWriter
PrintWriter to write to.
out
,
final Project
Project instance for the current task
p
,
final Hashtable<String, Class<?>>
map (name to implementing class)
tasks
,
final Hashtable<String, Class<?>>
map (name to implementing class) data types.
types
)

Implements org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printHead.

Prints the header of the generated output.
private void
printHead(final PrintWriter out, final Set<String> tasks, final Set<String> types)

Prints the header of the generated output.

public void
printTail(final PrintWriter
PrintWriter to write to.
out
)

Implements org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printTail.

Prints the trailer.
private void
printTargetAttrs(final PrintWriter out, final String tag)

Prints the definition for the target element.

public void
printTargetDecl(final PrintWriter
PrintWriter to write to.
out
)

Implements org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printTargetDecl.

Prints the definition for the target element.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BOOLEANback to summary
private static final String BOOLEAN
TASKSback to summary
private static final String TASKS
TYPESback to summary
private static final String TYPES
visitedback to summary
private final Hashtable<String, String> visited

Constructor Detail

DTDPrinterback to summary
private DTDPrinter()

Method Detail

areNmtokensback to summary
public static final boolean areNmtokens(final String[] s)

Do the Strings all match the XML-NMTOKEN production?

Otherwise they are not suitable as an enumerated attribute, for example.

Parameters
s:String[]

the array of string to test

Returns:boolean

true if all the strings in the array math XML-NMTOKEN

isNmtokenback to summary
public static final boolean isNmtoken(final String s)

Does this String match the XML-NMTOKEN production?

Parameters
s:String

the string to test

Returns:boolean

true if the string matches the XML-NMTOKEN

printElementDeclback to summary
public void printElementDecl(final PrintWriter out, final Project p, final String name, final Class<?> element)

Implements org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printElementDecl.

Print the definition for a given element.

Parameters
out:PrintWriter

Doc from org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printElementDecl.

PrintWriter to write to.

p:Project

Doc from org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printElementDecl.

Project instance for the current task

name:String

Doc from org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printElementDecl.

element name.

element:Class<?>

Doc from org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printElementDecl.

class of the defined element.

Annotations
@Override
printHeadback to summary
public void printHead(final PrintWriter out, final Project p, final Hashtable<String, Class<?>> tasks, final Hashtable<String, Class<?>> types)

Implements org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printHead.

Doc from org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printHead.

Prints the header of the generated output.

Parameters
out:PrintWriter

PrintWriter to write to.

p:Project

Project instance for the current task

tasks:Hashtable<String, Class<?>>

map (name to implementing class)

types:Hashtable<String, Class<?>>

map (name to implementing class) data types.

Annotations
@Override
printHeadback to summary
private void printHead(final PrintWriter out, final Set<String> tasks, final Set<String> types)

Prints the header of the generated output.

Basically this prints the XML declaration, defines some entities and the project element.

printTailback to summary
public void printTail(final PrintWriter out)

Implements org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printTail.

Doc from org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printTail.

Prints the trailer.

Parameters
out:PrintWriter

PrintWriter to write to.

Annotations
@Override
printTargetAttrsback to summary
private void printTargetAttrs(final PrintWriter out, final String tag)

Prints the definition for the target element.

printTargetDeclback to summary
public void printTargetDecl(final PrintWriter out)

Implements org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printTargetDecl.

Prints the definition for the target element.

Parameters
out:PrintWriter

Doc from org.apache.tools.ant.taskdefs.AntStructure.StructurePrinter.printTargetDecl.

PrintWriter to write to.

Annotations
@Override
org.apache.tools.ant.taskdefs back to summary

public Interface AntStructure.StructurePrinter

Known Direct Implementers
org.apache.tools.ant.taskdefs.AntStructure.DTDPrinter

Writes the actual structure information.

printHead, printTargetDecl and printTail are called exactly once, printElementDecl once for each declared task and type.

Method Summary

Modifier and TypeMethod and Description
public void
printElementDecl(PrintWriter
PrintWriter to write to.
out
,
Project
Project instance for the current task
p
,
String
element name.
name
,
Class<?>
class of the defined element.
element
)

Print the definition for a given element.

public void
printHead(PrintWriter
PrintWriter to write to.
out
,
Project
Project instance for the current task
p
,
Hashtable<String, Class<?>>
map (name to implementing class)
tasks
,
Hashtable<String, Class<?>>
map (name to implementing class) data types.
types
)

Prints the header of the generated output.

public void
printTail(PrintWriter
PrintWriter to write to.
out
)

Prints the trailer.

public void
printTargetDecl(PrintWriter
PrintWriter to write to.
out
)

Prints the definition for the target element.

Method Detail

printElementDeclback to summary
public void printElementDecl(PrintWriter out, Project p, String name, Class<?> element)

Print the definition for a given element.

Parameters
out:PrintWriter

PrintWriter to write to.

p:Project

Project instance for the current task

name:String

element name.

element:Class<?>

class of the defined element.

printHeadback to summary
public void printHead(PrintWriter out, Project p, Hashtable<String, Class<?>> tasks, Hashtable<String, Class<?>> types)

Prints the header of the generated output.

Parameters
out:PrintWriter

PrintWriter to write to.

p:Project

Project instance for the current task

tasks:Hashtable<String, Class<?>>

map (name to implementing class)

types:Hashtable<String, Class<?>>

map (name to implementing class) data types.

printTailback to summary
public void printTail(PrintWriter out)

Prints the trailer.

Parameters
out:PrintWriter

PrintWriter to write to.

printTargetDeclback to summary
public void printTargetDecl(PrintWriter out)

Prints the definition for the target element.

Parameters
out:PrintWriter

PrintWriter to write to.