public class DXLFileFragment extends Object implements DXLFragment
A file fragment is what should be used to load all static DXL code parts (like function declarations). Dynamic DXL parts should be loaded with a
DXLBufferFragment
.
Here is a snippet (see DXLEngine for a full snippet):
DXLEngine engine = ...; engine.execute(new DXLFRagment[] { DXLFileFragment.create(new File("c:\\dxl\\myScript.dxl").toURL()), DXLFileFragment.create(getClass().getResource("myScript.inc")) });
DXLEngine
,
DXLBufferFragment
Modifier and Type | Method and Description |
---|---|
static DXLFragment |
create(URL url)
Instantiates a fragment that will output the content of the specified URL.
|
void |
write(Writer writer)
Writes the content of this fragment into the specified writer.
|
public static DXLFragment create(URL url)
url
- the content to output into the DXL script.public void write(Writer writer) throws IOException
DXLFragment
DXLEngine
when combining
fragments into a DXL file.write
in interface DXLFragment
writer
- the writer in which to output the content of the fragment.IOException
- if the content cannot be written.