java类java.io.StringBufferInputStream的实例源码

IncludeFilterTest.java 文件源码 项目:VerveineC-Cpp 阅读 13 收藏 0 点赞 0 评论 0
public static void main(String[] args) throws IOException {
        byte[] srcBuf = new byte[SRC.length()];
        InputStream input = new IncludeToLowerInputStream( new StringBufferInputStream(SRC) );
//      InputStream input =  new StringBufferInputStream(SRC) ;

        if ( TGT.length() != input.read(srcBuf)) {
            System.err.println("too few charcaters in converted string");
            System.exit(0);
        };

        if (! TGT.equals(new String(srcBuf))) {
            System.err.println("Converted string not equal to expected string");
            System.exit(0);
        }

        System.out.println("Everything went accroding to plans");

        input.close();  // useless but avoid warnings in Eclipse
    }
Bug6573786.java 文件源码 项目:openjdk-jdk10 阅读 14 收藏 0 点赞 0 评论 0
void runTest(String xmlString) {
    Bug6573786ErrorHandler handler = new Bug6573786ErrorHandler();
    try {
        InputStream is = new StringBufferInputStream(xmlString);
        SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
        parser.parse(is, handler);
    } catch (Exception e) {
        if (handler.fail) {
            Assert.fail("The value of standalone attribute should be merged into the error message.");
        }
    }

}
CodePane.java 文件源码 项目:LewisOmniscientDebugger 阅读 27 收藏 0 点赞 0 评论 0
private static VectorD getDemoList(String sourceFileName) {
    BufferedReader r;
    if (Debugger.clazz == com.lambda.Debugger.QuickSortNonThreaded.class) {
    r = new BufferedReader(new InputStreamReader(new StringBufferInputStream(QuickSortNonThreadedString.programString)));
    return(buildFileLines(r, sourceFileName));
    }
    if (Debugger.clazz == com.lambda.Debugger.Rewrite.class) {
    r = new BufferedReader(new InputStreamReader(new StringBufferInputStream(RewriteString.programString)));
    return(buildFileLines(r, sourceFileName));
    }
    if (Debugger.clazz == com.lambda.Debugger.Demo.class) {
    r = new BufferedReader(new InputStreamReader(new StringBufferInputStream(DemoString.programString)));
    return(buildFileLines(r, sourceFileName));
    }
return null;
}
AntrlFileTest.java 文件源码 项目:sonar-tsql-plugin 阅读 16 收藏 0 点赞 0 评论 0
@Test
public void compareWithAntrl() {
    String s = "select " + "*" + "from dbo.test";
    AntrlResult result = Antlr4Utils.getFull(s);
    SourceLinesProvider p = new SourceLinesProvider();
    SourceLine[] lines = p.getLines(new StringBufferInputStream(s), Charset.defaultCharset());
    FillerRequest file = new FillerRequest(null, null, result.getTree(), lines);
    for (Token t : result.getStream().getTokens()) {
        if (t.getType() == Token.EOF) {
            continue;
        }
        int[] start = file.getLineAndColumn(t.getStartIndex());
        int[] end = file.getLineAndColumn(t.getStopIndex());
        Assert.assertNotNull(start);
        Assert.assertNotNull(end);
        Assert.assertEquals(t.getLine(), start[0]);
        System.out.println(t.getText() + Arrays.toString(start) + " " + t.getCharPositionInLine() + " "
                + t.getLine() + " " + Arrays.toString(end));
        Assert.assertEquals(t.getCharPositionInLine(), start[1]);
    }
}
MultipartMap.java 文件源码 项目:openxds 阅读 14 收藏 0 点赞 0 评论 0
/**
 * Used for testing and demonstration purposes.
 */
static public void main(String args[]) throws Exception, java.io.IOException {
    try {
        //String xx = "------=_Part_2_9110923.1073664290010\r\nContent-Type: text/plain\r\nContent-ID: urn:uuid:d4bfb124-7922-45bc-a03d-823351eed716\r\n\r\nhttp://ratbert.ncsl.nist.gov:8081/hl7services/transform.html\r\n------=_Part_2_9110923.1073664290010\r\nContent-Type: text/plain\r\nContent-ID: urn:uuid:45b90888-49c1-4b64-a8eb-e94f541368f0\r\n\r\nhttp://ratbert.ncsl.nist.gov:8081/hl7services/rawSQL.html\r\n------=_Part_2_9110923.1073664290010--\r\n";
        String xx = "------_Part_\r\nContent-Type: text/plain\r\nContent-ID: urn:uuid:d4bfb124-7922-45bc-a03d-823351eed716\r\n\r\nhttp://ratbert.ncsl.nist.gov:8081/hl7services/transform.html\r\n------_Part_\r\nContent-Type: text/plain\r\nContent-ID: urn:uuid:45b90888-49c1-4b64-a8eb-e94f541368f0\r\n\r\nhttp://ratbert.ncsl.nist.gov:8081/hl7services/rawSQL.html\r\n------_Part_--\r\n";
        StringBufferInputStream is = new StringBufferInputStream(xx);
        String contentType = "multipart/related; boundary=----_Part_";
        ByteArrayDataSource ds = new ByteArrayDataSource(is,  contentType);
        //ByteArrayDataSource ds = new ByteArrayDataSource();
        javax.mail.internet.MimeMultipart mp = new javax.mail.internet.MimeMultipart(ds);
        int i = mp.getCount();
    } catch (javax.mail.MessagingException me) {
        throw new Exception("messaging exception in parsing for MultipartMap");
    }
    System.out.println("Done");
}
DependencyTest.java 文件源码 项目:groovy 阅读 28 收藏 0 点赞 0 评论 0
public void testTransitiveDep(){
    cu.addSource("testTransitiveDep.gtest", new StringBufferInputStream(
            "class A1 {}\n" +
            "class A2 extends A1{}\n" +
            "class A3 extends A2{}\n"
    ));
    cu.compile(Phases.CLASS_GENERATION);
    cache.makeTransitiveHull();

    Set<String> dep = cache.get("A1");
    assertEquals(dep.size(),1);

    dep = cache.get("A2");
    assertEquals(dep.size(),2);
    assertTrue(dep.contains("A1"));

    dep = cache.get("A3");
    assertEquals(dep.size(),3);
    assertTrue(dep.contains("A1"));
    assertTrue(dep.contains("A2"));
}
InputTest.java 文件源码 项目:com.obdobion.funnelsort 阅读 23 收藏 0 点赞 0 评论 0
/**
 * <p>
 * sysinFileout.
 * </p>
 *
 * @throws java.lang.Throwable if any.
 */
@Test
public void sysinFileout() throws Throwable
{
    final String testName = Helper.testName();
    Helper.initializeFor(testName);

    final List<String> out = new ArrayList<>();
    out.add("line 1");
    out.add("line 2");

    final StringBuilder sb = new StringBuilder();
    for (final String outline : out)
        sb.append(outline).append(System.getProperty("line.separator"));
    final InputStream inputStream = new StringBufferInputStream(sb.toString());
    System.setIn(inputStream);

    final File file = Helper.outFileWhenInIsSysin();

    final FunnelContext context = Funnel.sort(Helper.config(), "-o" + file.getAbsolutePath()
            + " --row 2 -c original");

    Assert.assertEquals("records", 2L, context.getRecordCount());
    Helper.compare(file, out);
    Assert.assertTrue("delete " + file.getAbsolutePath(), file.delete());
}
TreeApplet.java 文件源码 项目:openbd-core 阅读 14 收藏 0 点赞 0 评论 0
private Vector getData(String a){
    //-- Put them together
    int x = 0;
    StringBuilder appletP   = new StringBuilder(128);
    String line = thisApplet.getParameter("treedata" + x);
    while (line!=null){
        appletP.append( line.substring(1,line.length()-1) );
        x++;
        line    = thisApplet.getParameter("treedata" + x);
    }

    String appletParam  = appletP.toString();

    tags        = new Stack();
    params  = new Stack();
    StringBufferInputStream s = new StringBufferInputStream(appletParam);   

    try{
        parseXML(s);
    }catch(Throwable E){
        E.printStackTrace();
        return null;
    }

    return (Vector)params.peek();
}
StreamTokenizerTest.java 文件源码 项目:In-the-Box-Fork 阅读 14 收藏 0 点赞 0 评论 0
/**
 * @tests java.io.StreamTokenizer#StreamTokenizer(java.io.InputStream)
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "StreamTokenizer",
    args = {java.io.InputStream.class}
)
public void test_ConstructorLjava_io_InputStream() throws IOException {
    st = new StreamTokenizer(new StringBufferInputStream(
            "/comments\n d 8 'h'"));

    assertEquals("the next token returned should be the letter d",
             StreamTokenizer.TT_WORD, st.nextToken());
    assertEquals("the next token returned should be the letter d",
             "d", st.sval);

    assertEquals("the next token returned should be the digit 8",
             StreamTokenizer.TT_NUMBER, st.nextToken());
    assertEquals("the next token returned should be the digit 8",
             8.0, st.nval);

    assertEquals("the next token returned should be the quote character",
             39, st.nextToken());
    assertEquals("the next token returned should be the quote character",
             "h", st.sval);
}
LightblueHttpClientTest.java 文件源码 项目:lightblue-client 阅读 18 收藏 0 点赞 0 评论 0
@Test
public void testStreaming() throws Exception {
    when(httpTransport.executeRequestGetStream(any(LightblueRequest.class),anyString())).
        thenReturn(new StringBufferInputStream(streamingResponse.replaceAll("'","\"")));
    LightblueClientConfiguration c = new LightblueClientConfiguration();
    try (LightblueHttpClient httpClient = new LightblueHttpClient(c, httpTransport)) {
        DataFindRequest findRequest = new DataFindRequest("test");
        findRequest.where(Query.withValue("a = b"));
        findRequest.select(Projection.includeField("foo"));
        ResultStream response=httpClient.prepareFind(findRequest);
        final List<JsonNode> docs=new ArrayList<JsonNode>();
        response.run(new ResultStream.ForEachDoc() {
                @Override
                public boolean processDocument(ResultStream.StreamDoc doc) {
                    docs.add(doc.doc);
                    return true;
                }
            });
        Assert.assertEquals(9,docs.size());

    }
}
LightblueHttpClientTest.java 文件源码 项目:lightblue-client 阅读 16 收藏 0 点赞 0 评论 0
@Test
public void testNotStreaming() throws Exception {
    when(httpTransport.executeRequestGetStream(any(LightblueRequest.class),anyString())).
        thenReturn(new StringBufferInputStream(nonStreamingResponse.replaceAll("'","\"")));
    LightblueClientConfiguration c = new LightblueClientConfiguration();
    try (LightblueHttpClient httpClient = new LightblueHttpClient(c, httpTransport)) {
        DataFindRequest findRequest = new DataFindRequest("test");
        findRequest.where(Query.withValue("a = b"));
        findRequest.select(Projection.includeField("foo"));
        ResultStream response=httpClient.prepareFind(findRequest);
        final List<JsonNode> docs=new ArrayList<JsonNode>();
        response.run(new ResultStream.ForEachDoc() {
                @Override
                public boolean processDocument(ResultStream.StreamDoc doc) {
                    docs.add(doc.doc);
                    return true;
                }
            });
        Assert.assertEquals(9,docs.size());

    }
}
CachedRowSetImpl.java 文件源码 项目:cn1 阅读 21 收藏 0 点赞 0 评论 0
@SuppressWarnings("deprecation")
public InputStream getUnicodeStream(int columnIndex) throws SQLException {
    Object obj = getObject(columnIndex);
    if (obj == null) {
        return null;
    }
    if (obj instanceof byte[]) {
        return new StringBufferInputStream(new String((byte[]) obj));
    }

    if (obj instanceof String) {
        return new StringBufferInputStream((String) obj);
    }

    if (obj instanceof char[]) {
        return new StringBufferInputStream(new String((char[]) obj));
    }

    // rowset.10=Data Type Mismatch
    throw new SQLException(Messages.getString("rowset.10")); //$NON-NLS-1$
}
CachedRowSetStreamTest.java 文件源码 项目:cn1 阅读 14 收藏 0 点赞 0 评论 0
public void testGetUnicodeStream_Not_Ascii() throws Exception {
    String value = new String("\u548c\u8c10");
    insertRow(100, value, null);
    rs = st.executeQuery("SELECT * FROM STREAM WHERE ID = 100");
    crset = newNoInitialInstance();
    crset.populate(rs);

    crset.next();

    assertTrue(crset.getObject(2) instanceof String);
    assertEquals(value, crset.getString(2));

    InputStream in = crset.getUnicodeStream(2);
    StringBufferInputStream sin = new StringBufferInputStream(value);

    int i = -1;
    while ((i = in.read()) != -1) {
        assertEquals(sin.read(), i);
    }

}
StreamTokenizerTest.java 文件源码 项目:cn1 阅读 15 收藏 0 点赞 0 评论 0
/**
 * @tests java.io.StreamTokenizer#StreamTokenizer(java.io.InputStream)
 */
@SuppressWarnings("deprecation")
   public void test_ConstructorLjava_io_InputStream() throws IOException {
    st = new StreamTokenizer(new StringBufferInputStream(
            "/comments\n d 8 'h'"));

    assertEquals("the next token returned should be the letter d",
             StreamTokenizer.TT_WORD, st.nextToken());
    assertEquals("the next token returned should be the letter d",
             "d", st.sval);

    assertEquals("the next token returned should be the digit 8",
             StreamTokenizer.TT_NUMBER, st.nextToken());
    assertEquals("the next token returned should be the digit 8",
             8.0, st.nval);

    assertEquals("the next token returned should be the quote character",
             39, st.nextToken());
    assertEquals("the next token returned should be the quote character",
             "h", st.sval);
}
WPSConfig.java 文件源码 项目:uDig-WPS-plugin 阅读 14 收藏 0 点赞 0 评论 0
private synchronized void readObject(java.io.ObjectInputStream oos) throws IOException, ClassNotFoundException
{       
    try
    {
        String wpsConfigXMLBeansAsXml = (String) oos.readObject();
        XmlObject configXmlObject = XmlObject.Factory.parse(wpsConfigXMLBeansAsXml);
        WPSConfigurationDocument configurationDocument = WPSConfigurationDocument.Factory.newInstance();
        configurationDocument.addNewWPSConfiguration().set(configXmlObject);
        wpsConfig = new WPSConfig(new StringBufferInputStream(configurationDocument.xmlText()));
    }
    catch (XmlException e)
    {
        LOGGER.error(e.getMessage());
        throw new IOException(e.getMessage());
    }
}
StreamTokenizerTest.java 文件源码 项目:freeVM 阅读 30 收藏 0 点赞 0 评论 0
/**
 * @tests java.io.StreamTokenizer#StreamTokenizer(java.io.InputStream)
 */
public void test_ConstructorLjava_io_InputStream() throws IOException {
    st = new StreamTokenizer(new StringBufferInputStream(
            "/comments\n d 8 'h'"));

    assertEquals("the next token returned should be the letter d",
             StreamTokenizer.TT_WORD, st.nextToken());
    assertEquals("the next token returned should be the letter d",
             "d", st.sval);

    assertEquals("the next token returned should be the digit 8",
             StreamTokenizer.TT_NUMBER, st.nextToken());
    assertEquals("the next token returned should be the digit 8",
             8.0, st.nval);

    assertEquals("the next token returned should be the quote character",
             39, st.nextToken());
    assertEquals("the next token returned should be the quote character",
             "h", st.sval);
}
CachedRowSetImpl.java 文件源码 项目:freeVM 阅读 19 收藏 0 点赞 0 评论 0
@SuppressWarnings("deprecation")
public InputStream getUnicodeStream(int columnIndex) throws SQLException {
    Object obj = getObject(columnIndex);
    if (obj == null) {
        return null;
    }
    if (obj instanceof byte[]) {
        return new StringBufferInputStream(new String((byte[]) obj));
    }

    if (obj instanceof String) {
        return new StringBufferInputStream((String) obj);
    }

    if (obj instanceof char[]) {
        return new StringBufferInputStream(new String((char[]) obj));
    }

    // rowset.10=Data Type Mismatch
    throw new SQLException(Messages.getString("rowset.10")); //$NON-NLS-1$
}
CachedRowSetStreamTest.java 文件源码 项目:freeVM 阅读 15 收藏 0 点赞 0 评论 0
public void testGetUnicodeStream_Not_Ascii() throws Exception {
    String value = new String("\u548c\u8c10");
    insertRow(100, value, null);
    rs = st.executeQuery("SELECT * FROM STREAM WHERE ID = 100");
    crset = newNoInitialInstance();
    crset.populate(rs);

    crset.next();

    assertTrue(crset.getObject(2) instanceof String);
    assertEquals(value, crset.getString(2));

    InputStream in = crset.getUnicodeStream(2);
    StringBufferInputStream sin = new StringBufferInputStream(value);

    int i = -1;
    while ((i = in.read()) != -1) {
        assertEquals(sin.read(), i);
    }

}
StreamTokenizerTest.java 文件源码 项目:freeVM 阅读 18 收藏 0 点赞 0 评论 0
/**
 * @tests java.io.StreamTokenizer#StreamTokenizer(java.io.InputStream)
 */
@SuppressWarnings("deprecation")
   public void test_ConstructorLjava_io_InputStream() throws IOException {
    st = new StreamTokenizer(new StringBufferInputStream(
            "/comments\n d 8 'h'"));

    assertEquals("the next token returned should be the letter d",
             StreamTokenizer.TT_WORD, st.nextToken());
    assertEquals("the next token returned should be the letter d",
             "d", st.sval);

    assertEquals("the next token returned should be the digit 8",
             StreamTokenizer.TT_NUMBER, st.nextToken());
    assertEquals("the next token returned should be the digit 8",
             8.0, st.nval);

    assertEquals("the next token returned should be the quote character",
             39, st.nextToken());
    assertEquals("the next token returned should be the quote character",
             "h", st.sval);
}
InputSource.java 文件源码 项目:jeql 阅读 15 收藏 0 点赞 0 评论 0
private InputStream createStreamUnchecked()
  throws Exception
{
  if (data != null) {
    return new StringBufferInputStream(data);
  }
  // TODO: handle protocols in case-insensitive way
  // TODO: add more protocol checks (or pattern?)
  if (isHTTP()) {
    URL url = new URL(srcName);
    return url.openStream();
  }
  // default: assume srcName refers to file
  return new FileInputStream(srcName);

}
ResolveTest.java 文件源码 项目:jcliff 阅读 14 收藏 0 点赞 0 评论 0
@Test
public void childrenTest() throws Exception {
    StringBufferInputStream is=new StringBufferInputStream("{\"A\"=>{"+
                                                           "\"B\"=>{"+
                                                           " \"c\"=>1L ,"+
                                                           " \"d\"=>2L ,"+
                                                           " \"e\"=>3L ,"+
                                                           " \"f\"=>4L ,"+
                                                           " \"g\"=>5L  } } }");
    ModelNode node=ModelNode.fromStream(is); 
    List<NodePath> allPaths=NodePath.getPaths(node);
    PathExpression p=new PathExpression("A","B");
    List<String> list=Configurable.getChildren(allPaths,p);
    Assert.assertEquals(5,list.size());
    Assert.assertEquals("c",list.get(0));
    Assert.assertEquals("d",list.get(1));
    Assert.assertEquals("e",list.get(2));
    Assert.assertEquals("f",list.get(3));
    Assert.assertEquals("g",list.get(4));
}
ResolveTest.java 文件源码 项目:jcliff 阅读 16 收藏 0 点赞 0 评论 0
@Test
public void loopTest() throws Exception {
    StringBufferInputStream is=new StringBufferInputStream("{\"A\"=>{"+
                                                           "\"B\"=>{"+
                                                           " \"c\"=>1L ,"+
                                                           " \"d\"=>2L ,"+
                                                           " \"e\"=>3L ,"+
                                                           " \"f\"=>4L ,"+
                                                           " \"g\"=>5L  } } }");
    ModelNode node=ModelNode.fromStream(is); 
    ctx.configPaths=NodePath.getPaths(node);

    String[] script=Configurable.resolve(new PathExpression("A","B"),
                                    ctx.configPaths,
                                    "${foreach-cfg (/A/B),(/subsystem=test/do-something:${name(.)},${value(.)}) }",
                                    ctx);
    Assert.assertEquals("/subsystem=test/do-something:c,1L",script[0]);
    Assert.assertEquals("/subsystem=test/do-something:d,2L",script[1]);
    Assert.assertEquals("/subsystem=test/do-something:e,3L",script[2]);
    Assert.assertEquals("/subsystem=test/do-something:f,4L",script[3]);
    Assert.assertEquals("/subsystem=test/do-something:g,5L",script[4]);
}
AbstractDevice.java 文件源码 项目:OpenNotification 阅读 19 收藏 0 点赞 0 评论 0
public static Device createFromXML(String xml) throws NotificationException {
    Device device = null;
    try {
        Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new StringBufferInputStream(xml));
        NodeList types = document.getElementsByTagName("type");
        if ((types == null) || (types.getLength()<=0)) {
            throw new NotificationException(NotificationException.NOT_ACCEPTABLE, "Device type not specified");
        }
        String type = types.item(0).getFirstChild().getNodeValue();
        BrokerFactory.getLoggingBroker().logDebug("new type="+type);
        device = (Device)Class.forName(type).newInstance();

        device.readXML(document.getElementsByTagName("settings").item(0));
    } catch (Exception anyExc) {
        BrokerFactory.getLoggingBroker().logError(anyExc);
        throw new NotificationException(NotificationException.FAILED, anyExc.getMessage());
    }

    return device;
}
ExternalTaskRestServiceImplTest.java 文件源码 项目:camunda-task-dispatcher 阅读 19 收藏 0 点赞 0 评论 0
@Before
public void test() throws IOException {
    Mockito.when(objectMapper.writeValueAsString(Mockito.any())).thenReturn("JSON");
    Mockito.when(objectMapper.getTypeFactory()).thenReturn(typeFactory);
    Mockito.when(objectMapper.readValue(Mockito.<InputStream>any(), Mockito.<JavaType>any())).thenReturn(Collections.singletonList(new LockedExternalTaskDto()));

    Mockito.when(httpClient.execute(Mockito.any())).thenReturn(response);

    Mockito.when(response.getEntity()).thenReturn(httpEntity);
    Mockito.when(response.getStatusLine()).thenReturn(statusLine);

    Mockito.when(statusLine.getStatusCode()).thenReturn(HttpStatus.SC_OK);

    Mockito.when(httpEntity.getContent()).thenReturn(new StringBufferInputStream("http response"));

    service = new ExternalTaskRestServiceImpl();

    JavaUtils.setFieldWithoutCheckedException(
            ReflectionUtils.findField(ExternalTaskRestServiceImpl.class, "objectMapper")
            , service
            , objectMapper
    );
    JavaUtils.setFieldWithoutCheckedException(
            ReflectionUtils.findField(ExternalTaskRestServiceImpl.class, "httpClient")
            , service
            , httpClient
    );
    JavaUtils.setFieldWithoutCheckedException(
            ReflectionUtils.findField(ExternalTaskRestServiceImpl.class, "engineUrl")
            , service
            , "someurl"
    );
}
HttpServletRequestStub.java 文件源码 项目:oscm 阅读 20 收藏 0 点赞 0 评论 0
@Override
public ServletInputStream getInputStream() throws IOException {

    if (throwExceptionForISAccess) {
        throw new IOException();
    }
    return new BufferedServletInputStream(new StringBufferInputStream(
            bodyContent));
}
IntLogicalSysEditor.java 文件源码 项目:Open_Source_ECOA_Toolset_AS5 阅读 23 收藏 0 点赞 0 评论 0
@Override
public void doSave(IProgressMonitor monitor) {
    try {
        LogicalSystemNode node = (LogicalSystemNode) root.getModel();
        FileEditorInput inp = (FileEditorInput) getEditorInput();
        inp.getFile().setContents(new StringBufferInputStream(ParseUtil.getLogicalSysEditorContent(node)), IFile.FORCE, monitor);
        getCommandStack().markSaveLocation();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
IntFinalAssemblyEditor.java 文件源码 项目:Open_Source_ECOA_Toolset_AS5 阅读 27 收藏 0 点赞 0 评论 0
@Override
public void doSave(IProgressMonitor monitor) {
    try {
        CompositeNode node = (CompositeNode) root.getModel();
        FileEditorInput inp = (FileEditorInput) getEditorInput();
        inp.getFile().setContents(new StringBufferInputStream(ParseUtil.getIntFinalAssemblyEditorContent(node)), IFile.FORCE, monitor);
        getCommandStack().markSaveLocation();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
IntDeploymentEditor.java 文件源码 项目:Open_Source_ECOA_Toolset_AS5 阅读 26 收藏 0 点赞 0 评论 0
@Override
public void doSave(IProgressMonitor monitor) {
    try {
        DeploymentNode node = (DeploymentNode) root.getModel();
        FileEditorInput inp = (FileEditorInput) getEditorInput();
        inp.getFile().setContents(new StringBufferInputStream(ParseUtil.getIntDeploymentEditorContent(node)), IFile.FORCE, monitor);
        getCommandStack().markSaveLocation();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
CompImplEditor.java 文件源码 项目:Open_Source_ECOA_Toolset_AS5 阅读 22 收藏 0 点赞 0 评论 0
@Override
public void doSave(IProgressMonitor monitor) {
    try {
        ComponentImplementationNode node = (ComponentImplementationNode) root.getModel();
        FileEditorInput inp = (FileEditorInput) getEditorInput();
        inp.getFile().setContents(new StringBufferInputStream(ParseUtil.getCompImplEditorContent(node)), IFile.FORCE, monitor);
        getCommandStack().markSaveLocation();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
InitAssemblyEditor.java 文件源码 项目:Open_Source_ECOA_Toolset_AS5 阅读 25 收藏 0 点赞 0 评论 0
@Override
public void doSave(IProgressMonitor monitor) {
    try {
        CompositeNode node = (CompositeNode) root.getModel();
        FileEditorInput inp = (FileEditorInput) getEditorInput();
        inp.getFile().setContents(new StringBufferInputStream(ParseUtil.getInitAssemblyEditorContent(node)), IFile.FORCE, monitor);
        getCommandStack().markSaveLocation();
    } catch (Exception e) {
        e.printStackTrace();
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号