Examples of TextEncoder


Examples of com.google.code.gaeom.impl.encoder.TextEncoder

        {
          return new EnumEncoder(propertyName, clazz, index);
        }
        else if (field.getAnnotation(Text.class) != null)
        {
          return new TextEncoder(propertyName);
        }
        else if (char.class == clazz || Character.class == clazz)
        {
          return new CharEncoder(propertyName, index);
        }
View Full Code Here

Examples of org.exoplatform.commons.utils.TextEncoder

            }

            // Encode data
            try {
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                TextEncoder encoder = CharsetTextEncoder.getUTF8();
                char[] buffer = new char[256];
                for (int l = script.read(buffer); l != -1; l = script.read(buffer)) {
                    encoder.encode(buffer, 0, l, out);
                }
                return new ScriptResult.Resolved(out.toByteArray());
            } finally {
                Safe.close(script);
            }
View Full Code Here

Examples of org.exoplatform.commons.utils.TextEncoder

         // Encode data
         try
         {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            TextEncoder encoder = CharsetTextEncoder.getUTF8();
            char[] buffer = new char[256];
            for (int l = script.read(buffer);l != -1;l = script.read(buffer))
            {
               encoder.encode(buffer, 0, l, out);
            }
            return new ScriptResult.Resolved(out.toByteArray());
         }
         finally
         {
View Full Code Here

Examples of org.exoplatform.commons.utils.TextEncoder

         // Encode data
         try
         {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            TextEncoder encoder = CharsetTextEncoder.getUTF8();
            char[] buffer = new char[256];
            for (int l = script.read(buffer);l != -1;l = script.read(buffer))
            {
               encoder.encode(buffer, 0, l, out);
            }
            return new ScriptResult.Resolved(out.toByteArray());
         }
         finally
         {
View Full Code Here

Examples of org.jboss.dna.common.text.TextEncoder

            this.context = context;
            this.sourceName = nameOfSourceToBeSearchable;
            this.connectionFactory = connectionFactory;
            // Define the configuration ...
            TextEncoder encoder = new UrlEncoder();
            if (indexDirectory != null) {
                File indexDir = new File(indexDirectory);
                if (indexDir.exists()) {
                    // The location does exist ...
                    if (!indexDir.isDirectory()) {
View Full Code Here

Examples of org.jboss.dna.common.text.TextEncoder

        assertThat(path, hasSegments(pathFactory, "a", "b", "c"));
    }

    @Test
    public void shouldConvertPathToString() {
        TextEncoder encoder = new Jsr283Encoder();
        TextEncoder delimEncoder = new TextEncoder() {
            public String encode( String text ) {
                if ("/".equals(text)) return "\\/";
                if (":".equals(text)) return "\\:";
                if ("{".equals(text)) return "\\{";
                if ("}".equals(text)) return "\\}";
View Full Code Here

Examples of org.jboss.dna.common.text.TextEncoder

        assertThat(path1.equals(path2), is(false));
    }

    @Test
    public void shouldConvertPathToString() {
        TextEncoder encoder = new Jsr283Encoder();
        TextEncoder delimEncoder = new TextEncoder() {
            public String encode( String text ) {
                if ("/".equals(text)) return "\\/";
                if (":".equals(text)) return "\\:";
                if ("{".equals(text)) return "\\{";
                if ("}".equals(text)) return "\\}";
View Full Code Here

Examples of org.jboss.dna.common.text.TextEncoder

    }

    @Test
    public void shouldAlwaysReturnPathWithSingleSlashForGetString() {
        NamespaceRegistry registry = mock(NamespaceRegistry.class);
        TextEncoder encoder = mock(TextEncoder.class);
        stub(encoder.encode("/")).toReturn("/");
        assertThat(root.getString(), is("/"));
        assertThat(root.getString(registry), is("/"));
        assertThat(root.getString(registry, encoder), is("/"));
        assertThat(root.getString(registry, encoder, encoder), is("/"));
        assertThat(root.getString(encoder), is("/"));
View Full Code Here

Examples of org.jboss.dna.common.text.TextEncoder

        assertThat(root.getString(encoder), is("/"));
    }

    @Test
    public void shouldAllowNullNamespaceRegistryWithNonNullTextEncodersSinceRegistryIsNotNeeded() {
        TextEncoder encoder = mock(TextEncoder.class);
        stub(encoder.encode("/")).toReturn("/");
        assertThat(root.getString((NamespaceRegistry)null, encoder, encoder), is("/"));
    }
View Full Code Here

Examples of org.jboss.dna.common.text.TextEncoder

    }

    @Test
    public void shouldNotAllowNullTextEncoderForDelimiterWithNonNullNamespaceRegistry() {
        NamespaceRegistry registry = mock(NamespaceRegistry.class);
        TextEncoder encoder = mock(TextEncoder.class);
        assertThat(root.getString(registry, encoder, (TextEncoder)null), is("/"));
    }
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.