设计模式课程 设计模式精讲 20-3 解释器模式源码解析

混江龙づ霸主 提交于 2020-02-16 11:01:24

1    源码解析

1.1    源码解析1(jdk中的应用)

1.2    源码解析2(Spring中的应用)

 

 

 

 

1    源码解析
1.1    源码解析1(jdk中的应用

java.util.regex.Pattern

(java正则表达式通过java.util.regex包下的Pattern类与Matcher类实现)

 

 

1.2    源码解析2(Spring中的应用)

org.springframework.core.io.Resource(策略抽象)

package org.springframework.core.io;

import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URL;

public interface Resource extends InputStreamSource {
    boolean exists();

    boolean isReadable();

    boolean isOpen();

    URL getURL() throws IOException;

    URI getURI() throws IOException;

    File getFile() throws IOException;

    long contentLength() throws IOException;

    long lastModified() throws IOException;

    Resource createRelative(String var1) throws IOException;

    String getFilename();

    String getDescription();
}

 

 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!