@Test public void parserTest() throws Exception { Collection<PropertyBase> properties = parser.parseProperties("urn:resource:org/richfaces/cdk/xmlconfig/fragment.xml"); assertEquals(3, properties.size()); }
public Collection<PropertyBase> parseProperties(String url) throws CdkException, FileNotFoundException { String schemaLocation = ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION; Class<Fragment> bindClass = Fragment.class; Fragment unmarshal = binding.unmarshal(url, schemaLocation, bindClass); if (null != unmarshal) { ComponentModel component = adapter.unmarshal(unmarshal); return component.getAttributes(); } else { return Collections.<PropertyBase>emptySet(); } }
FragmentParser { public Collection<PropertyBase> parseProperties(String url) throws CdkException, FileNotFoundException { String schemaLocation = ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION; Class<Fragment> bindClass = Fragment.class; Fragment unmarshal = binding.unmarshal(url, schemaLocation, bindClass); if (null != unmarshal) { ComponentModel component = adapter.unmarshal(unmarshal); return component.getAttributes(); } else { return Collections.<PropertyBase>emptySet(); } } }
FragmentParser { public Collection<PropertyBase> parseProperties(String url) throws CdkException, FileNotFoundException { String schemaLocation = ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION; Class<Fragment> bindClass = Fragment.class; Fragment unmarshal = binding.unmarshal(url, schemaLocation, bindClass); if (null != unmarshal) { ComponentModel component = adapter.unmarshal(unmarshal); return component.getAttributes(); } else { return Collections.<PropertyBase>emptySet(); } } @Inject  FragmentParser(JAXB binding); }
FragmentParser { public Collection<PropertyBase> parseProperties(String url) throws CdkException, FileNotFoundException { String schemaLocation = ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION; Class<Fragment> bindClass = Fragment.class; Fragment unmarshal = binding.unmarshal(url, schemaLocation, bindClass); if (null != unmarshal) { ComponentModel component = adapter.unmarshal(unmarshal); return component.getAttributes(); } else { return Collections.<PropertyBase>emptySet(); } } @Inject  FragmentParser(JAXB binding); Collection<PropertyBase> parseProperties(String url); }
FragmentParser { public Collection<PropertyBase> parseProperties(String url) throws CdkException, FileNotFoundException { String schemaLocation = ComponentLibrary.FACES_CONFIG_SCHEMA_LOCATION; Class<Fragment> bindClass = Fragment.class; Fragment unmarshal = binding.unmarshal(url, schemaLocation, bindClass); if (null != unmarshal) { ComponentModel component = adapter.unmarshal(unmarshal); return component.getAttributes(); } else { return Collections.<PropertyBase>emptySet(); } } @Inject  FragmentParser(JAXB binding); Collection<PropertyBase> parseProperties(String url);  }