public abstract class SWFTarget extends Target implements ISWFTarget
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SWFTarget.FramesInformation
|
protected static class |
SWFTarget.SWFFrameInfo |
Target.BuiltCompilationUnitSet, Target.DirectDependencies, Target.RootedCompilationUnitsITarget.TargetType| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
metadataDonators |
progressMonitor, project, targetSettings| Constructor and Description |
|---|
SWFTarget(CompilerProject project,
ITargetSettings targetSettings,
ITargetProgressMonitor progressMonitor) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addCompilationUnitsAndDependenciesToFrame(SWFFrame frame,
Collection<ICompilationUnit> rootedUnitsForFrame,
boolean allowExternals,
Set<ICompilationUnit> emittedCompilationUnits) |
protected abstract void |
addLinkedABCToFrame(SWFFrame targetFrame,
Iterable<DoABCTag> inputABCs,
ABCLinker.ABCLinkerSettings linkSettings) |
ISWF |
build(Collection<ICompilerProblem> problems)
Adds frames and tags to those frames for all the content generated by the
target.
|
protected SWF |
buildEmptySWF()
Creates a new instance of a SWF.
|
protected abstract SWFTarget.FramesInformation |
computeFramesInformation()
Create the
SWFTarget.FramesInformation which contains the skeleton for the frames
of this SWF. |
protected Target.RootedCompilationUnits |
computeRootedCompilationUnits()
Computes the set of compilation units that root the dependency walk.
|
protected abstract ITargetAttributes |
computeTargetAttributes()
round-up user specified target attributes
All derived classes must provide one, but they are free to provide "do nothing" implementations
(like NilTargetAttributes)
|
protected ITargetReport |
computeTargetReport() |
protected SWFFrame |
createWithClassesAndItsDependencies(SWFFrame frame,
Collection<ClassDefinition> frameRootClasses,
ASProjectScope projectScope,
boolean allowExternals,
Set<ICompilationUnit> emittedCompilationUnits)
Add a set of root classes and its dependencies to a new frame or to an existing
frame.
|
protected void |
doAddMetadataNamesToTarget(ICompilationUnit cu,
boolean linkedIn)
Add metadata names to the target for this compilation unit.
|
protected void |
doPostBuildWork(com.google.common.collect.ImmutableSet<ICompilationUnit> compilationUnits,
Collection<ICompilerProblem> problems)
Check the build and analyze the results before the SWF target is
initialized.
|
protected RGB |
getBackgroundColor() |
protected SWFTarget.FramesInformation |
getFramesInformation() |
Target.RootedCompilationUnits |
getRootedCompilationUnits()
Gets the set of
ICompilationUnits that are the roots of the graph of
ICompilationUnits whose output will be in the generate SWF. |
protected ITargetAttributes |
getTargetAttributes() |
ITarget.TargetType |
getTargetType()
Returns the type of this target.
|
protected ISWF |
initializeSWF(List<ICompilationUnit> reachableCompilationUnits)
Initialize SWF model with default header values from the target settings
when not overridden by the target attributes.
|
protected ISWF |
linkSWF(ISWF unLinked)
Link the swf - this handles merging the DoABC tags inside each frame, and will
also handle stripping debug opcodes, optimizing the abcs, and/or stripping metadata
|
protected void |
reportProblem(ICompilerProblem problem)
Add to the collection of compiler problems.
|
protected abstract void |
setKeepAS3MetadataLinkerSetting(ABCLinker.ABCLinkerSettings linkSettings) |
protected boolean |
shouldAddMetadataNamesToTarget(ICompilationUnit cu,
boolean linkedIn)
Test if any metadata names associated with the compilation unit should be
added to the target.
|
protected boolean |
testCompilationUnitLinkage(ICompilationUnit cu,
boolean allowExternals)
Test if a compilation unit should be include in this target.
|
addASMetadataNames, buildAllCompilationUnits, buildFinished, buildStarted, computeFatalProblems, createLinkReport, findAllCompilationUnitsToLink, getAllExternallyVisibleDefinitions, getASMetadataNames, getBuiltCompilationUnitSet, getDependentCompilationUnits, getDirectDependencies, getFatalProblems, getIncludedResourceBundlesCompilationUnits, getIncludeLibrariesCompilationUnits, getIncludesCompilationUnits, getLinkageChecker, getReachableCompilationUnits, getTargetReport, getTargetSettings, isCanceled, isLinkageExternal, setLinkageChecker, updateProgress, updateProgress, waitForCompilationUnitToFinishclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetASMetadataNames, getIncludesCompilationUnits, getTargetReport, getTargetSettingspublic SWFTarget(CompilerProject project, ITargetSettings targetSettings, ITargetProgressMonitor progressMonitor)
public Target.RootedCompilationUnits getRootedCompilationUnits() throws InterruptedException
ICompilationUnits that are the roots of the graph of
ICompilationUnits whose output will be in the generate SWF.getRootedCompilationUnits in class TargetICompilationUnits that are the roots of the graph of
ICompilationUnits whose output will be in the generate SWFInterruptedExceptionpublic ISWF build(Collection<ICompilerProblem> problems)
ISWFTargetbuild in interface ISWFTargetproblems - Collection to which all problems of all
CompilationUnits whose output is added to the specified ISWF are added.public ITarget.TargetType getTargetType()
ITargetgetTargetType in interface ITargetprotected final ITargetAttributes getTargetAttributes() throws InterruptedException
InterruptedExceptionprotected abstract ITargetAttributes computeTargetAttributes() throws InterruptedException
InterruptedExceptionprotected abstract SWFTarget.FramesInformation computeFramesInformation() throws InterruptedException
SWFTarget.FramesInformation which contains the skeleton for the frames
of this SWF. The actual frames will be create in doCreateFrames().InterruptedExceptionprotected final SWFTarget.FramesInformation getFramesInformation() throws InterruptedException
InterruptedExceptionprotected void doPostBuildWork(com.google.common.collect.ImmutableSet<ICompilationUnit> compilationUnits, Collection<ICompilerProblem> problems) throws InterruptedException
compilationUnits - The set of compilation units after
buildAndCollectProblems() has run.problems - A collection where discovered problems are appended.InterruptedExceptionprotected SWF buildEmptySWF()
protected void reportProblem(ICompilerProblem problem)
problem - protected SWFFrame createWithClassesAndItsDependencies(SWFFrame frame, Collection<ClassDefinition> frameRootClasses, ASProjectScope projectScope, boolean allowExternals, Set<ICompilationUnit> emittedCompilationUnits) throws InterruptedException
frame - if null a new frame will be created for the classes. Otherwise the
classes will be added to the existing frame.frameRootClasses - projectScope - allowExternals - emittedCompilationUnits - InterruptedExceptionprotected boolean addCompilationUnitsAndDependenciesToFrame(SWFFrame frame, Collection<ICompilationUnit> rootedUnitsForFrame, boolean allowExternals, Set<ICompilationUnit> emittedCompilationUnits) throws InterruptedException
InterruptedExceptionprotected void doAddMetadataNamesToTarget(ICompilationUnit cu, boolean linkedIn)
cu - linkedIn - true if the compilation unit is linked in, false if
external.protected boolean shouldAddMetadataNamesToTarget(ICompilationUnit cu, boolean linkedIn)
cu - linkedIn - true if the compilation unit is linked in, false if
external.protected boolean testCompilationUnitLinkage(ICompilationUnit cu, boolean allowExternals) throws InterruptedException
cu - allowExternals - InterruptedExceptionprotected abstract void addLinkedABCToFrame(SWFFrame targetFrame, Iterable<DoABCTag> inputABCs, ABCLinker.ABCLinkerSettings linkSettings) throws Exception
Exceptionprotected abstract void setKeepAS3MetadataLinkerSetting(ABCLinker.ABCLinkerSettings linkSettings)
protected ISWF linkSWF(ISWF unLinked)
unLinked - the SWF to processprotected Target.RootedCompilationUnits computeRootedCompilationUnits() throws InterruptedException
For SWFTarget's the set of rooted ICompilationUnits is computed
by enumerating all the frames and collecting all the ICompilationUnits assigned
to each of the frames.
computeRootedCompilationUnits in class TargetICompilationUnit's.InterruptedExceptionprotected ISWF initializeSWF(List<ICompilationUnit> reachableCompilationUnits) throws InterruptedException
InterruptedExceptionprotected final RGB getBackgroundColor() throws InterruptedException
InterruptedExceptionprotected ITargetReport computeTargetReport() throws InterruptedException
computeTargetReport in class TargetInterruptedExceptionCopyright © 2016 The Apache Software Foundation. All rights reserved.