// Create a new Source for the node.
VirtualFile virtualFile = new TextFile("", unit.getSource().getName() + "$" + className,
unit.getSource().getName(), unit.getSource().getParent(),
MimeMappings.MXML, unit.getSource().getLastModified());
Source source = new Source(virtualFile, unit.getSource(), className, false, false);
// Set the Source's syntax tree to the DocumentNode
// equivalent of the grandchild, so that the text
// representation won't have to be recreated and reparsed.
DocumentNode inlineDocumentNode =
DocumentNode.inlineDocumentNode(componentRoot.getNamespace(), componentRoot.getLocalPart(),
NameFormatter.toDot(docInfo.getPackageName(), docInfo.getClassName()));
inlineDocumentNode.beginLine = componentRoot.beginLine;
inlineDocumentNode.beginColumn = componentRoot.beginColumn;
inlineDocumentNode.endLine = componentRoot.endLine;
inlineDocumentNode.endColumn = componentRoot.endColumn;
inlineDocumentNode.image = componentRoot.image;
// Inline components are line inner classes, so there need to be suppressed in the asdoc.
if(generateAst)
{
inlineDocumentNode.comment = "<description><![CDATA[]]></description><private><![CDATA[]]></private>";
}
else
{
inlineDocumentNode.comment = "@private";
}
componentRoot.copy(inlineDocumentNode);
inlineDocumentNode.setLocalClassMappings(docInfo.getLocalClassMappings());
inlineDocumentNode.setLanguageNamespace(docInfo.getLanguageNamespace());
inlineDocumentNode.setVersion(docInfo.getVersion());
addExcludeClassNode(inlineDocumentNode, componentRoot);
source.addSourceFragment(AttrInlineComponentSyntaxTree, inlineDocumentNode, null);
unit.addGeneratedSource(classQName, source);
}