Migrate to apache KIe 10.0 Remove all non existing features (like Business Central)
This commit is contained in:
parent
e460b26abb
commit
87390f9dd1
247 changed files with 406 additions and 21084 deletions
|
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
* Copyright 2014 Pymma Software
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.drools.common.jaxb;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
import java.io.StringWriter;
|
||||
|
||||
public final class JAXBContextUtils {
|
||||
|
||||
public static <T> String marshallObjectAsString(Class<T> clazz, T object) throws JAXBException {
|
||||
JAXBContext jaxbContext = JAXBContext.newInstance(clazz);
|
||||
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
|
||||
|
||||
// output pretty printed
|
||||
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
|
||||
StringWriter writer = new StringWriter();
|
||||
jaxbMarshaller.marshal(object, writer);
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright 2014 Pymma Software
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.drools.common.jaxb;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
||||
public class JAXBContextUtilsTest {
|
||||
|
||||
@Test
|
||||
public void testMarshallObjectAsString() throws Exception {
|
||||
ToTestClass toTestClass = new ToTestClass();
|
||||
toTestClass.setAttr1("attr1");
|
||||
toTestClass.setAttr2("attr2");
|
||||
|
||||
String toEvaluate = JAXBContextUtils.marshallObjectAsString(ToTestClass.class, toTestClass);
|
||||
|
||||
assertThat(toEvaluate).isNotNull();
|
||||
assertThat(toEvaluate).isEqualTo("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
|
||||
"<toTestClass>\n" +
|
||||
" <attr1>attr1</attr1>\n" +
|
||||
" <attr2>attr2</attr2>\n" +
|
||||
"</toTestClass>\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
* Copyright 2014 Pymma Software
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.drools.common.jaxb;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.PROPERTY)
|
||||
@XmlType(propOrder = {"attr1", "attr2"})
|
||||
public class ToTestClass {
|
||||
private String attr1;
|
||||
private String attr2;
|
||||
|
||||
public ToTestClass() {
|
||||
|
||||
}
|
||||
|
||||
public String getAttr1() {
|
||||
return attr1;
|
||||
}
|
||||
|
||||
public void setAttr1(String attr1) {
|
||||
this.attr1 = attr1;
|
||||
}
|
||||
|
||||
public String getAttr2() {
|
||||
return attr2;
|
||||
}
|
||||
|
||||
public void setAttr2(String attr2) {
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue