Package com.volantis.mcs.cli.uaprofclient.translator

Examples of com.volantis.mcs.cli.uaprofclient.translator.AttributeTranslator


             fixed.hasNext(); ) {
           
            // NOTE: It would make sense to verify that there are no names
            // registered against any of the fixed processors. 
           
            AttributeTranslator processor = (AttributeTranslator) fixed.next();
            processor.processAttribute(inputMap, outputMap);
           
        }
       
        //
        // Then, process the remaining "normal" attributes.
        // These may only take a single input since they have their name
        // mapping defined in an external properties file, and are processed
        // one attribute at a time in an iterator.
        //
       
        // Iterate over the Attributes.
        for (Iterator attributes = inputMap.keySet().iterator();
             attributes.hasNext(); ) {

            // Process a single attribute value.
            String inputName = (String) attributes.next();
            Object inputValue = inputMap.get(inputName);
            AttributeTranslator processor = null;
           
            // Look up the translated name.
            String outputName = (String) nameTranslationMap.get(inputName);
            // If we found a translated name.
            if (outputName != null) {

                // We can process the attribute.

                // Find the processor based on the value type.
                if (inputValue instanceof Collection) {
                   
                    // It needs translation from a collection into a CSV.
                    processor = new CollectionTranslator(attributes,
                            inputName, inputValue, outputName, this);
                   
                } else {
                   
                    // Just try default translation for the other types.
                    processor = new SimpleTranslator(attributes,
                            inputName, inputValue, outputName, this);
                   
                }
               
                // OK, we have a processor, so lets process this attribute.
                processor.processAttribute(inputMap, outputMap);
               
            } else {
               
                // This attribute is not present in the name translation
                // file. In this case, we assume that it is not valid in MCS,
View Full Code Here

TOP

Related Classes of com.volantis.mcs.cli.uaprofclient.translator.AttributeTranslator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.