Examples of AmpReference


Examples of com.bazaarvoice.jolt.common.reference.AmpReference

        AssertJUnit.assertEquals( 3, refElement.getTokens().size() );
        AssertJUnit.assertEquals( "tuna-", (String) refElement.getTokens().get(0) );
        AssertJUnit.assertEquals( "-marlin", (String) refElement.getTokens().get(2) );

        AssertJUnit.assertTrue( refElement.getTokens().get(1) instanceof AmpReference );
        AmpReference ref = (AmpReference) refElement.getTokens().get(1);
        AssertJUnit.assertEquals( 0, ref.getPathIndex() );
        AssertJUnit.assertEquals( 1, ref.getKeyGroup() );
    }
View Full Code Here

Examples of com.bazaarvoice.jolt.common.reference.AmpReference

                AssertJUnit.assertTrue( refElement.getTokens().get(0) instanceof String );
                AssertJUnit.assertEquals( "photos-", (String) refElement.getTokens().get(0) );
            }
            {
                AssertJUnit.assertTrue( refElement.getTokens().get(1) instanceof AmpReference );
                AmpReference ref = (AmpReference) refElement.getTokens().get(1);
                AssertJUnit.assertEquals( "&(1,0)", ref.getCanonicalForm() );
                AssertJUnit.assertEquals( 1, ref.getPathIndex() );
                AssertJUnit.assertEquals( 0, ref.getKeyGroup() );
            }
            {
                AssertJUnit.assertTrue( refElement.getTokens().get(2) instanceof String );
                AssertJUnit.assertEquals( "-bob", (String) refElement.getTokens().get(2) );
            }
View Full Code Here

Examples of com.bazaarvoice.jolt.common.reference.AmpReference

                    canonicalBuilder.append( literal );
                    literal = new StringBuilder();
                }

                int refEnd = findEndOfReference( key.substring( index + 1 ) );
                AmpReference ref = new AmpReference(key.substring(index, index + refEnd + 1) );
                canonicalBuilder.append( ref.getCanonicalForm() );

                tok.add( ref );
                index += refEnd;
            }
            else {
View Full Code Here

Examples of com.bazaarvoice.jolt.common.reference.AmpReference

        for ( Object token : tokens ) {
            if ( token instanceof String ) {
                output.append( token );
            }
            else {
                AmpReference ref = (AmpReference) token;
                LiteralPathElement literalPathElement = walkedPath.elementFromEnd( ref.getPathIndex() ).getLiteralPathElement();
                String value = literalPathElement.getSubKeyRef( ref.getKeyGroup() );
                output.append( value );
            }
        }

        return output.toString();
View Full Code Here

Examples of com.bazaarvoice.jolt.common.reference.AmpReference

        }
        else {
            String meat = key.substring( 1, key.length() - 1 )// trim the [ ]

            if ( AmpReference.TOKEN.equals( meat.charAt( 0 ) ) ) {
                r = new AmpReference( meat );
                apt = ArrayPathType.REFERENCE;

                canonicalForm = "[" + r.getCanonicalForm() + "]";
            }
            else if ( HashReference.TOKEN.equals( meat.charAt( 0 ) ) ) {
View Full Code Here

Examples of com.bazaarvoice.jolt.common.reference.AmpReference

                    canonicalBuilder.append( literal );
                    literal = new StringBuilder();
                }

                int refEnd = findEndOfReference( key.substring( index + 1 ) );
                AmpReference ref = new AmpReference(key.substring(index, index + refEnd + 1) );
                canonicalBuilder.append( ref.getCanonicalForm() );

                tok.add( ref );
                index += refEnd;
            }
            else {
View Full Code Here

Examples of com.bazaarvoice.jolt.common.reference.AmpReference

        for ( Object token : tokens ) {
            if ( token instanceof String ) {
                output.append( token );
            }
            else {
                AmpReference ref = (AmpReference) token;
                LiteralPathElement literalPathElement = walkedPath.elementFromEnd( ref.getPathIndex() );
                String value = literalPathElement.getSubKeyRef( ref.getKeyGroup() );
                output.append( value );
            }
        }

        return output.toString();
View Full Code Here

Examples of com.bazaarvoice.jolt.common.reference.AmpReference

        }
        else {
            String meat = key.substring( 1, key.length() - 1 )// trim the [ ]

            if ( AmpReference.TOKEN.equals( meat.charAt( 0 ) ) ) {
                r = new AmpReference( meat );
                apt = ArrayPathType.REFERENCE;

                canonicalForm = "[" + r.getCanonicalForm() + "]";
            }
            else if ( HashReference.TOKEN.equals( meat.charAt( 0 ) ) ) {
View Full Code Here

Examples of com.bazaarvoice.jolt.common.reference.AmpReference

                    canonicalBuilder.append( literal );
                    literal = new StringBuilder();
                }

                int refEnd = findEndOfReference( key.substring( index + 1 ) );
                AmpReference ref = new AmpReference(key.substring(index, index + refEnd + 1) );
                canonicalBuilder.append( ref.getCanonicalForm() );

                tok.add( ref );
                index += refEnd;
            }
            else {
View Full Code Here

Examples of com.bazaarvoice.jolt.common.reference.AmpReference

        for ( Object token : tokens ) {
            if ( token instanceof String ) {
                output.append( token );
            }
            else {
                AmpReference ref = (AmpReference) token;
                LiteralPathElement literalPathElement = walkedPath.elementFromEnd( ref.getPathIndex() );
                String value = literalPathElement.getSubKeyRef( ref.getKeyGroup() );
                output.append( value );
            }
        }

        return output.toString();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.