Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2014 Attila Szegedi, Daniel Dekany, Jonathan Revusky
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * 
  * http://www.apache.org/licenses/LICENSE-2.0
  * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package freemarker.template;
Holds DefaultObjectWrapper configuration settings and defines their defaults. You will not use this abstract class directly, but concrete subclasses like DefaultObjectWrapperBuilder. Unless, you are developing a builder for a custom DefaultObjectWrapper subclass. In that case, note that overriding the equals(java.lang.Object) and hashCode() is important, as these object are used as ObjectWrapper singleton lookup keys.

Since:
2.3.22
    
    private boolean useAdaptersForContainers;
    private boolean forceLegacyNonListCollections;
    protected DefaultObjectWrapperConfiguration(Version incompatibleImprovements) {
        super(DefaultObjectWrapper.normalizeIncompatibleImprovementsVersion(incompatibleImprovements), true);
         = true// [2.4]: = IcI < _TemplateAPI.VERSION_INT_2_4_0;
    }

    
    public boolean getUseAdaptersForContainers() {
        return ;
    }

    
    public void setUseAdaptersForContainers(boolean useAdaptersForContainers) {
        this. = useAdaptersForContainers;
    }
    
    
    public boolean getForceLegacyNonListCollections() {
        return ;
    }

    
    public void setForceLegacyNonListCollections(boolean legacyNonListCollectionWrapping) {
        this. = legacyNonListCollectionWrapping;
    }
    
    public int hashCode() {
        int result = super.hashCode();
        final int prime = 31;
        result = result * prime + ( ? 1231 : 1237);
        result = result * prime + ( ? 1231 : 1237);
        return result;
    }
    public boolean equals(Object that) {
        if (!super.equals(that)) return false;
        final DefaultObjectWrapperConfiguration thatDowCfg = (DefaultObjectWrapperConfigurationthat;
        return  == thatDowCfg.getUseAdaptersForContainers()
                &&  == thatDowCfg.forceLegacyNonListCollections;
    }
New to GrepCode? Check out our FAQ X