Spring框架文档 - 核心技术部分 中英双语版 第二部分 内容目录

Spring Framework Documentation

5.3.10

Core Technologies

下载此文档pdf版              返回文档下载页面

Spring框架文档 - 核心技术部分 中英双语版 第二部分 内容目录

2. Resources (资源) 407

2.1. Introduction(介绍) 407

2.2. The Resource Interface(Resource 接口)... 408

2.3. Built-in Resource Implementations(内置Resource 实现) 411

2.3.1. UrlResource. 412

2.3.2. ClassPathResource. 413

2.3.3. FileSystemResource. 414

2.3.4. PathResource. 414

2.3.5. ServletContextResource. 415

2.3.6. InputStreamResource. 415

2.3.7. ByteArrayResource. 416

2.4. The ResourceLoader Interface (ResourceLoader 接口)... 417

2.5. The ResourcePatternResolver Interface(ResourcePatternResolver 接口)... 420

2.6. The ResourceLoaderAware Interface (ResourceLoaderAware 接口)... 422

2.7. Resources as Dependencies (资源作为依赖) 424

2.8. Application Contexts and Resource Paths(应用程序上下文和资源路径) 428

2.8.1. Constructing Application Contexts(构建应用程序上下文) 428

2.8.1.1. Constructing ClassPathXmlApplicationContext Instances — Shortcuts (构造ClassPathXmlApplicationContext实例 :捷径) 430

2.8.2. Wildcards in Application Context Constructor Resource Paths(应用程序上下文构造函数资源路径中的通配符) 431

2.8.2.1. Ant-style Patterns (Ant样式模式)... 432

2.8.2.2. The classpath*: Prefix ( “classpath*: ” 前缀)... 434

2.8.2.3. Other Notes Relating to Wildcards(与通配符有关的其它说明) 436

2.8.3. FileSystemResource Caveats (FileSystemResource 警告)... 438

3. Validation, Data Binding, and Type Conversion(验证、数据绑定和类型转换) 441

3.1. Validation by Using Spring’s Validator Interface (使用Spring的Validator接口进行验证) 442

3.2. Resolving Codes to Error Messages(将代码解析为错误消息) 448

3.3. Bean Manipulation and the BeanWrapper (Bean操作和BeanWrapper) 449

3.3.1. Setting and Getting Basic and Nested Properties (设置和获取基本属性和嵌套属性) 450

3.3.2. Built-in PropertyEditor Implementations(内置PropertyEditor 实现) 454

3.3.2.1. Registering Additional Custom PropertyEditor Implementations (注册其它自定义PropertyEditor 实现) 461

3.4. Spring Type Conversion (Spring类型转换)... 468

3.4.1. Converter SPI(转换器SPI) 468

3.4.2. Using ConverterFactory (使用ConverterFactory) 470

3.4.3. Using GenericConverter (使用GenericConverter) 471

3.4.3.1. Using ConditionalGenericConverter (使用ConditionalGenericConverter) 473

3.4.4. The ConversionService API (ConversionService API) 474

3.4.5. Configuring a ConversionService (配置ConversionService) 475

3.4.6. Using a ConversionService Programmatically (通过编程使用ConversionService ) 477

3.5. Spring Field Formatting (Spring字段格式化) 479

3.5.1. The Formatter SPI(Formatter SPI)... 480

3.5.2. Annotation-driven Formatting(注解驱动的格式化) 483

3.5.2.1. Format Annotation API (格式注解API) 487

3.5.3. The FormatterRegistry SPI (FormatterRegistry SPI) 487

3.5.4. The FormatterRegistrar SPI (FormatterRegistrar SPI) 489

3.5.5. Configuring Formatting in Spring MVC(在SpringMVC中配置格式化) 490

3.6. Configuring a Global Date and Time Format (配置全局日期和时间格式) 490

3.7. Java Bean Validation (Java Bean验证)... 493

3.7.1. Overview of Bean Validation (Bean验证概述) 493

3.7.2. Configuring a Bean Validation Provider(配置Bean验证提供者) 495

3.7.2.1. Injecting a Validator(注入验证器) 496

3.7.2.2. Spring-driven Method Validation(Spring驱动的方法验证)... 499

3.7.2.3. Additional Configuration Options(其它配置选项) 501

3.7.3. Configuring a DataBinder(配置DataBinder) 501

3.7.4. Spring MVC 3 Validation (Spring MVC 3验证)... 502

4. Spring Expression Language (SpEL) (Spring表达式语言(SpEL))... 504

4.1. Evaluation (计算) 506

4.1.1. Understanding EvaluationContext (理解EvaluationContext) 512

4.1.1.1. Type Conversion (类型转换) 513

4.1.2. Parser Configuration (解析器配置) 514

4.1.3. SpEL Compilation (SpEL编译) 516

4.1.3.1. Compiler Configuration(编译器配置) 518

4.1.3.2. Compiler Limitations(编译器限制) 521

4.2. Expressions in Bean Definitions (Bean定义中的表达式) 522

4.2.1. XML Configuration (XML配置) 522

4.2.2. Annotation Configuration(注解配置) 523

4.3. Language Reference(语言参考) 526

4.3.1. Literal Expressions(字面量表达式) 528

4.3.2. Properties, Arrays, Lists, Maps, and Indexers(属性、数组、列表、映射和索引器) 529

4.3.3. Inline Lists(内联列表) 532

4.3.4. Inline Maps(内联Map) 533

4.3.5. Array Construction(构建数组) 534

4.3.6. Methods(方法) 535

4.3.7. Operators (运算符) 535

4.3.7.1. Relational Operators(关系运算符) 536

4.3.7.2. Logical Operators(逻辑运算符) 539

4.3.7.3. Mathematical Operators(数学运算符) 541

4.3.7.4. The Assignment Operator(赋值运算符) 543

4.3.8. Types (类型) 543

4.3.9. Constructors (构造函数) 544

4.3.10. Variables (变量) 545

4.3.10.1 The #this and #root Variables ( #this和#root变量)... 546

4.3.11. Functions (函数) 548

4.3.12. Bean References (Bean引用)... 549

4.3.13. Ternary Operator (If-Then-Else) (三元运算符(If-Then-Else)) 551

4.3.14. The Elvis Operator (Elvis运算符) 552

4.3.15. Safe Navigation Operator(安全导航运算符) 554

4.3.16. Collection Selection (集合选择) 555

4.3.17. Collection Projection  (集合投影) 557

4.3.18. Expression templating (表达式模板) 558

4.4. Classes Used in the Examples (案例中用到的类) 560

5. Aspect Oriented Programming with Spring (Spring面向切面编程)... 566

5.1. AOP Concepts (AOP概念)... 568

5.2. Spring AOP Capabilities and Goals (Spring AOP功能和目标) 572

5.3. AOP Proxies (AOP代理)... 575

5.4. @AspectJ support (支持@AspectJ) 576

5.4.1. Enabling @AspectJ Support (启用@AspectJ支持)... 576

5.4.1.1. Enabling @AspectJ Support with Java Configuration (通过Java配置启用@AspectJ支持) 577

5.4.1.2. Enabling @AspectJ Support with XML Configuration (使用XML配置启用@AspectJ支持) 577

5.4.2. Declaring an Aspect  (声明一个切面(Aspect)) 578

5.4.3. Declaring a Pointcut (声明切入点) 580

5.4.3.1. Supported Pointcut Designators(支持的切入点指示符) 582

5.4.3.2. Combining Pointcut Expressions(组合切入点表达式) 586

5.4.3.3. Sharing Common Pointcut Definitions(共享公共的切入点定义) 588

5.4.3.4. Examples (举例) 592

5.4.3.5. Writing Good Pointcuts(编写良好的切入点) 598

5.4.4. Declaring Advice(声明通知) 599

5.4.4.1. Before Advice (前置通知) 600

5.4.4.2. After Returning Advice (返回后通知) 601

5.4.4.3. After Throwing Advice (抛出后通知) 604

5.4.4.4. After (Finally) Advice. 606

5.4.4.5. Around Advice (环绕通知) 608

5.4.4.6. Advice Parameters (通知参数) 610

5.4.4.7. Advice Ordering (通知排序) 620

5.4.5. Introductions (引入) 622

5.4.6. Aspect Instantiation Models (切面实例化模型) 624

5.4.7. An AOP Example (AOP举例)... 626

5.5. Schema-based AOP Support (基于Schema的AOP支持) 631

5.5.1. Declaring an Aspect (声明一个切面) 632

5.5.2. Declaring a Pointcut (声明一个切入点) 633

5.5.3. Declaring Advice (声明通知) 636

5.5.3.1. Before Advice (前置通知) 636

5.5.3.2. After Returning Advice (返回后通知) 638

5.5.3.3. After Throwing Advice (抛出后通知) 639

5.5.3.4. After (Finally) Advice  (后置(最终)通知) 640

5.5.3.5. Around Advice (环绕通知) 641

5.5.3.6. Advice Parameters (通知参数) 643

5.5.3.7. Advice Ordering (通知排序) 647

5.5.4. Introductions (引入) 648

5.5.5. Aspect Instantiation Models (切面实例化模型) 650

5.5.6. Advisors (通知者) 650

5.5.7. An AOP Schema Example(AOP Schema举例)... 652

5.6. Choosing which AOP Declaration Style to Use(选择要使用的AOP声明样式) 656

5.6.1. Spring AOP or Full AspectJ? (Spring AOP还是全部采用AspectJ?) 657

5.6.2. @AspectJ or XML for Spring AOP? (Spring AOP采用@AspectJ 还是XML)... 658

5.7. Mixing Aspect Types (混合切面类型) 660

5.8. Proxying Mechanisms (代理机制) 661

5.8.1. Understanding AOP Proxies (理解AOP代理) 663

5.9. Programmatic Creation of @AspectJ Proxies(编程创建@AspectJ代理)... 668

5.10. Using AspectJ with Spring Applications (与Spring应用程序一起使用AspectJ) 670

5.10.1. Using AspectJ to Dependency Inject Domain Objects with Spring (使用AspectJ向Spring注入依赖领域对象) 671

5.10.1.1. Unit Testing @Configurable Objects (@Configurable对象的单元测试)... 678

5.10.1.2. Working with Multiple Application Contexts(使用多个应用程序上下文) 678

5.10.2. Other Spring aspects for AspectJ (AspectJ的其它Spring切面) 680

5.10.3. Configuring AspectJ Aspects by Using Spring IoC (使用Spring IoC配置AspectJ切面) 682

5.10.4. Load-time Weaving with AspectJ in the Spring Framework  (在Spring框架中加载时织入AspectJ切面) 684

5.10.4.1. A First Example (第一个例子) 685

5.10.4.2. Aspects (切面) 693

5.10.4.3. 'META-INF/aop.xml' 693

5.10.4.4. Required libraries (JARS) (所需的库(JARS)) 694

5.10.4.5. Spring Configuration (Spring配置)... 694

5.10.4.6. Environment-specific Configuration  (环境相关的配置) 701

5.11. Further Resources (更多资源) 703

6. Spring AOP APIs. 704

6.1. Pointcut API in Spring (Spring中的切入点API)... 704

6.1.1. Concepts (概念) 704

6.1.2. Operations on Pointcuts (切入点上的操作) 706

6.1.3. AspectJ Expression Pointcuts  (AspectJ表达式切入点) 707

6.1.4. Convenience Pointcut Implementations(方便的切入点实现) 707

6.1.4.1. Static Pointcuts(静态切入点) 708

6.1.4.2. Dynamic pointcuts (动态切入点) 710

6.1.5. Pointcut Superclasses (切入点超类) 711

6.1.6. Custom Pointcuts(自定义切入点) 712

6.2. Advice API in Spring  (Spring中的通知API) 712

6.2.1. Advice Lifecycles (通知生命周期) 713

6.2.2. Advice Types in Spring(Spring中的通知类型)... 713

6.2.2.1. Interception Around Advice (拦截环绕通知) 714

6.2.2.2. Before Advice (前置通知) 716

6.2.2.3. Throws Advice (抛出通知) 718

6.2.2.4. After Returning Advice (返回后通知) 721

6.2.2.5. Introduction Advice (引入通知) 723

6.3. The Advisor API in Spring (Spring中的通知者API)... 730

6.4. Using the ProxyFactoryBean to Create AOP Proxies (使用ProxyFactoryBean 创建AOP代理) 731

6.4.1. Basics (基础) 731

6.4.2. JavaBean Properties (JavaBean属性) 732

6.4.3. JDK- and CGLIB-based proxies (基于JDK和(基于CGLIB的代理) 735

6.4.4. Proxying Interfaces (代理接口) 737

6.4.5. Proxying Classes (代理类) 741

6.4.6. Using “Global” Advisors (使用全局通知者) 742

6.5. Concise Proxy Definitions (简明代理定义) 743

6.6. Creating AOP Proxies Programmatically with the ProxyFactory (使用ProxyFactory以编程方式创建AOP代理) 745

6.7. Manipulating Advised Objects (操作被通知对象) 747

6.8. Using the "auto-proxy" facility (使用自动代理) 751

6.8.1. Auto-proxy Bean Definitions (自动代理bean定义) 752

6.8.1.1. BeanNameAutoProxyCreator 752

6.8.1.2. DefaultAdvisorAutoProxyCreator 753

6.9. Using TargetSource Implementations (使用TargetSource 实现) 756

6.9.1. Hot-swappable Target Sources(热交换目标源) 757

6.9.2. Pooling Target Sources (池化目标源) 759

6.9.3. Prototype Target Sources (Prototype目标源)... 762

6.9.4. ThreadLocal Target Sources (ThreadLocal 目标源)... 763

6.10. Defining New Advice Types (定义新的通知类型) 764

7. Null-safety (Null安全性)... 766

7.1. Use cases (用例) 767

7.2. JSR-305 meta-annotations (JSR-305元注解)... 767

8. Data Buffers and Codecs(数据缓冲区和编解码器) 769

8.1. DataBufferFactory. 769

8.2. DataBuffer 770

8.3. PooledDataBuffer 771

8.4. DataBufferUtils. 772

8.5. Codecs(编解码器) 772

8.6. Using DataBuffer (使用DataBuffer) 773

9. Logging (日志) 777

10. Appendix (附录) 779

10.1. XML Schemas. 779

10.1.1. The util Schema (util Schema) 779

10.1.1.1. Using <util:constant/>   (使用<util:constant/>) 779

10.1.1.2. Using <util:property-path/>  (使用<util:property-path/>) 783

10.1.1.3. Using <util:properties/> (使用<util:properties/>) 787

10.1.1.3. Using <util:list/>  (使用<util:list/>) 787

10.1.1.4. Using <util:map/>  (使用<util:map/>) 789

10.1.1.5. Using <util:set/>  (使用 <util:set/>) 790

10.1.2. The aop Schema (aop Schema) 792

10.1.3. The context Schema (context Schema) 793

10.1.3.1. Using <property-placeholder/>  (使用<property-placeholder/>) 793

10.1.3.2. Using <annotation-config/>  (使用<annotation-config/>) 794

10.1.3.3. Using <component-scan/>  (使用<component-scan/>) 795

10.1.3.4. Using <load-time-weaver/>  (使用 <load-time-weaver/>) 795

10.1.3.5. Using <spring-configured/>  (使用<spring-configured/>) 795

10.1.3.6. Using <mbean-export/> (使用 <mbean-export/>) 795

10.1.4. The Beans Schema  (Beans Schema) 796

10.2. XML Schema Authoring (编写XML schema) 797

10.2.1. Authoring the Schema  (编写Schema) 799

10.2.2. Coding a NamespaceHandler (编写NamespaceHandler) 801

10.2.3. Using BeanDefinitionParser  (使用BeanDefinitionParser) 803

10.2.4. Registering the Handler and the Schema (注册处理器和Schema) 806

10.2.4.1. Writing META-INF/spring.handlers  (编写ETA-INF/spring.handlers) 807

10.2.4.2. Writing 'META-INF/spring.schemas'  (编写“META-INF/spring.schemas”) 807

10.2.5. Using a Custom Extension in Your Spring XML Configuration(在Spring XML配置中使用自定义扩展) 808

10.2.6. More Detailed Examples (更多详细示例) 809

10.2.6.1. Nesting Custom Elements within Custom Elements(在自定义元素中嵌套自定义元素) 809

10.3. Application Startup Steps(应用程序启动步骤) 825

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

月满闲庭

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值