Package org.jdom.input

Examples of org.jdom.input.JDOMFactory.element()


     */
    public void testOrderedSetCanHandleTypeElement() throws Exception {
        JDOMFactory factory = new DefaultJDOMFactory();
        Element type = factory.element(DeviceRepositorySchemaConstants.
                POLICY_DEFINITION_TYPE_ELEMENT_NAME);
        Element orderedSet = factory.element(
                DeviceRepositorySchemaConstants.
                POLICY_DEFINITION_ORDEREDSET_ELEMENT_NAME);
        type.addContent(orderedSet);

        assertTrue("Should be able to handle an " +
View Full Code Here


    /**
     * TestPolicyTypeComposition.UNORDERED_SET#canHandleType(Element).
     */
    public void testUnorderedSetCanHandleTypeElement() throws Exception {
        JDOMFactory factory = new DefaultJDOMFactory();
        Element type = factory.element(DeviceRepositorySchemaConstants.
                POLICY_DEFINITION_TYPE_ELEMENT_NAME);
        Element orderedSet = factory.element(
                DeviceRepositorySchemaConstants.
                POLICY_DEFINITION_UNORDEREDSET_ELEMENT_NAME);
        type.addContent(orderedSet);
View Full Code Here

     */
    public void testUnorderedSetCanHandleTypeElement() throws Exception {
        JDOMFactory factory = new DefaultJDOMFactory();
        Element type = factory.element(DeviceRepositorySchemaConstants.
                POLICY_DEFINITION_TYPE_ELEMENT_NAME);
        Element orderedSet = factory.element(
                DeviceRepositorySchemaConstants.
                POLICY_DEFINITION_UNORDEREDSET_ELEMENT_NAME);
        type.addContent(orderedSet);

        assertTrue("Should be able to handle an " +
View Full Code Here

     * @param policyType the policy type
     * @return the type element
     */
    private Element createTypeElement(PolicyType policyType) {
        JDOMFactory factory = new DefaultJDOMFactory();
        Element type = factory.element(DeviceRepositorySchemaConstants.
                POLICY_DEFINITION_TYPE_ELEMENT_NAME);
        // this is a bit clumsy
        if (policyType == PolicyType.EMULATE_EMPHASIS_TAG) {
            type.setAttribute(DeviceRepositorySchemaConstants.
                                POLICY_DEFINITION_TYPE_NAME_ATTRIBUTE_NAME,
View Full Code Here

        if (policyType == PolicyType.EMULATE_EMPHASIS_TAG) {
            type.setAttribute(DeviceRepositorySchemaConstants.
                                POLICY_DEFINITION_TYPE_NAME_ATTRIBUTE_NAME,
                              PolicyType.EMULATE_EMPHASIS_TAG.getName());
        }
        Element element = factory.element(
                policyType.getName());
        type.addContent(element);
        return type;
    }
View Full Code Here

    /**
     * Test canHandleType(Element) with a StuctureComposition.
     */
    public void testCanHandleTypeElementStructure() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Element type = factory.element(DeviceRepositorySchemaConstants.
                POLICY_DEFINITION_TYPE_ELEMENT_NAME);
        Element range = factory.element("range");
        type.addContent(range);
        assertFalse("Should not be able handle type with no name attribute",
                PolicyTypeComposition.STRUCTURE.canHandleType(type));
View Full Code Here

     */
    public void testCanHandleTypeElementStructure() {
        JDOMFactory factory = new DefaultJDOMFactory();
        Element type = factory.element(DeviceRepositorySchemaConstants.
                POLICY_DEFINITION_TYPE_ELEMENT_NAME);
        Element range = factory.element("range");
        type.addContent(range);
        assertFalse("Should not be able handle type with no name attribute",
                PolicyTypeComposition.STRUCTURE.canHandleType(type));

        range.detach();
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.