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.RootedCompilationUnits
ITarget.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
ICompilationUnit s that are the roots of the graph of
ICompilationUnit s 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, waitForCompilationUnitToFinish
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getASMetadataNames, getIncludesCompilationUnits, getTargetReport, getTargetSettings
public SWFTarget(CompilerProject project, ITargetSettings targetSettings, ITargetProgressMonitor progressMonitor)
public Target.RootedCompilationUnits getRootedCompilationUnits() throws InterruptedException
ICompilationUnit
s that are the roots of the graph of
ICompilationUnit
s whose output will be in the generate SWF.getRootedCompilationUnits
in class Target
ICompilationUnit
s that are the roots of the graph of
ICompilationUnit
s whose output will be in the generate SWFInterruptedException
public ISWF build(Collection<ICompilerProblem> problems)
ISWFTarget
build
in interface ISWFTarget
problems
- Collection to which all problems of all
CompilationUnits whose output is added to the specified ISWF are added.public ITarget.TargetType getTargetType()
ITarget
getTargetType
in interface ITarget
protected final ITargetAttributes getTargetAttributes() throws InterruptedException
InterruptedException
protected abstract ITargetAttributes computeTargetAttributes() throws InterruptedException
InterruptedException
protected 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().InterruptedException
protected final SWFTarget.FramesInformation getFramesInformation() throws InterruptedException
InterruptedException
protected 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.InterruptedException
protected 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
- InterruptedException
protected boolean addCompilationUnitsAndDependenciesToFrame(SWFFrame frame, Collection<ICompilationUnit> rootedUnitsForFrame, boolean allowExternals, Set<ICompilationUnit> emittedCompilationUnits) throws InterruptedException
InterruptedException
protected 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
- InterruptedException
protected abstract void addLinkedABCToFrame(SWFFrame targetFrame, Iterable<DoABCTag> inputABCs, ABCLinker.ABCLinkerSettings linkSettings) throws Exception
Exception
protected 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 ICompilationUnit
s is computed
by enumerating all the frames and collecting all the ICompilationUnit
s assigned
to each of the frames.
computeRootedCompilationUnits
in class Target
ICompilationUnit
's.InterruptedException
protected ISWF initializeSWF(List<ICompilationUnit> reachableCompilationUnits) throws InterruptedException
InterruptedException
protected final RGB getBackgroundColor() throws InterruptedException
InterruptedException
protected ITargetReport computeTargetReport() throws InterruptedException
computeTargetReport
in class Target
InterruptedException
Copyright © 2016 The Apache Software Foundation. All rights reserved.