Examples of PropertyLoader


Examples of com.codingcrayons.aspectfaces.properties.PropertyLoader

public class PropertyLoaderTest {

  @Test(expectedExceptions = ConfigurationFileNotFoundException.class)
  public void testNullValueOnNonExFile() throws ConfigurationFileNotFoundException, ConfigurationParsingException {
    // non-existing property file
    PropertyLoader loader = new PropertyLoader("wheee");
    // throws here
    String test = loader.getProperty("test");
    assertNull(test);
  }
View Full Code Here

Examples of com.codingcrayons.aspectfaces.properties.PropertyLoader

  }

  @Test(expectedExceptions = ConfigurationFileNotFoundException.class)
  public void testDefaultValueOnNonExFile() throws ConfigurationFileNotFoundException, ConfigurationParsingException {
    // non-existing property file
    PropertyLoader loader = new PropertyLoader("wheee");
    // throws here
    String test = loader.getProperty("test", "test");
    assertEquals(test, "test");
  }
View Full Code Here

Examples of com.codingcrayons.aspectfaces.properties.PropertyLoader

    assertEquals(test, "test");
  }

  @Test
  public void testNullValue() throws IOException {
    PropertyLoader loader = new PropertyLoader(new StringReader("test2=true"));
    String test = loader.getProperty("test");
    assertNull(test);
  }
View Full Code Here

Examples of com.codingcrayons.aspectfaces.properties.PropertyLoader

    assertNull(test);
  }

  @Test
  public void testDefaultValue() throws IOException {
    PropertyLoader loader = new PropertyLoader(new StringReader("test2=true"));
    String test = loader.getProperty("test", "test");
    assertEquals(test, "test");
  }
View Full Code Here

Examples of com.codingcrayons.aspectfaces.properties.PropertyLoader

    assertEquals(test, "test");
  }

  @Test
  public void testGettingProperty() throws IOException {
    PropertyLoader loader = new PropertyLoader(new StringReader("test=true"));
    String test = loader.getProperty("test");
    assertEquals(test, "true");
  }
View Full Code Here

Examples of nextapp.echo2.app.componentxml.PropertyLoader

        Element imageElement = DomUtil.getChildElementByTagName(fillImageElement, "image");
        if (imageElement == null) {
            throw new InvalidPropertyException("Invalid FillImage property.", null);
        }
        String imageType = imageElement.getAttribute("type");
        PropertyLoader propertyLoader = PropertyLoader.forClassLoader(classLoader);
       
        Class propertyClass;
        try {
            propertyClass = Class.forName(imageType, true, classLoader);
        } catch (ClassNotFoundException ex) {
            throw new InvalidPropertyException("Invalid FillImage property (type \"" + imageType + "\" not found.", ex);
        }
       
        Object imagePropertyValue = propertyLoader.getPropertyValue(FillImage.class, propertyClass, imageElement);
        if (!(imagePropertyValue instanceof ImageReference)) {
            throw new InvalidPropertyException("Invalid FillImage property (type \"" + imageType
                    + "\" is not an ImageReference.", null);
        }
View Full Code Here

Examples of nextapp.echo2.app.componentxml.PropertyLoader

        if (fillImageBorderElement == null) {
            throw new InvalidPropertyException("Invalid FillImageBorder property.", null);
        }

        FillImageBorder fillImageBorder = new FillImageBorder();
        PropertyLoader propertyLoader = PropertyLoader.forClassLoader(classLoader);
       
        if (fillImageBorderElement.hasAttribute("color")) {
            Color color = ColorPeer.toColor(fillImageBorderElement.getAttribute("color"));
            fillImageBorder.setColor(color);
        }
        if (fillImageBorderElement.hasAttribute("border-insets")) {
            Insets insets = InsetsPeer.toInsets(fillImageBorderElement.getAttribute("border-insets"));
            fillImageBorder.setBorderInsets(insets);
        }
        if (fillImageBorderElement.hasAttribute("content-insets")) {
            Insets insets = InsetsPeer.toInsets(fillImageBorderElement.getAttribute("content-insets"));
            fillImageBorder.setContentInsets(insets);
        }
       
        NodeList borderPartList = fillImageBorderElement.getElementsByTagName("border-part");
        int borderPartCount = borderPartList.getLength();
        for (int i = 0; i < borderPartCount; ++i) {
            Element borderPartElement = (Element) borderPartList.item(i);
            String position = borderPartElement.getAttribute("position");

            FillImage fillImage = (FillImage) propertyLoader.getPropertyValue(FillImageBorder.class, FillImage.class,
                    borderPartElement);
           
            if ("top-left".equals(position)) {
                fillImageBorder.setFillImage(FillImageBorder.TOP_LEFT, fillImage);
            } else if ("top".equals(position)) {
View Full Code Here

Examples of nextapp.echo2.app.componentxml.PropertyLoader

        try {
            Element layoutDataElement = DomUtil.getChildElementByTagName(propertyElement, "layout-data");
            String type = layoutDataElement.getAttribute("type");

            // Load properties from XML into Style.
            PropertyLoader propertyLoader = PropertyLoader.forClassLoader(classLoader);
            Element propertiesElement = DomUtil.getChildElementByTagName(layoutDataElement, "properties");
            Style propertyStyle = propertyLoader.createStyle(propertiesElement, type);
           
            // Instantiate LayoutData instance.
            Class propertyClass = Class.forName(type, true, classLoader);
            LayoutData layoutData = (LayoutData) propertyClass.newInstance();
           
View Full Code Here

Examples of org.apache.tuscany.core.loader.PropertyLoader

        registerLoader(loaderRegistry, new ComponentTypeElementLoader(loaderRegistry));
        registerLoader(loaderRegistry, new CompositeLoader(loaderRegistry, null));
        registerLoader(loaderRegistry, new IncludeLoader(loaderRegistry));
        registerLoader(loaderRegistry,
            new InterfaceJavaLoader(loaderRegistry, new JavaInterfaceProcessorRegistryImpl()));
        registerLoader(loaderRegistry, new PropertyLoader(loaderRegistry));
        registerLoader(loaderRegistry, new ReferenceLoader(loaderRegistry));
        registerLoader(loaderRegistry, new ServiceLoader(loaderRegistry));
        registerLoader(loaderRegistry, new SystemImplementationLoader(loaderRegistry));
        registerLoader(loaderRegistry, new SystemBindingLoader(loaderRegistry));
        return loaderRegistry;
View Full Code Here

Examples of pl.net.bluesoft.rnd.util.i18n.impl.PropertyLoader

            ProcessToolRegistry registry = (ProcessToolRegistry) servletContext.getAttribute(ProcessToolRegistry.class.getName());

            final String providerId = "step-editor";
            if (!registry.hasI18NProvider(providerId)) {
                registry.registerI18NProvider(
                        new PropertiesBasedI18NProvider(new PropertyLoader() {
                            @Override
                            public InputStream loadProperty(String path) throws IOException {
                                return getClass().getClassLoader().getResourceAsStream(path);
                            }
                        }, providerId + "-messages"),
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.