Skip to content

Commit

Permalink
Merge pull request #86 from sebplorenz/trimClassNames#85
Browse files Browse the repository at this point in the history
Added formatter to trim class names in jqassistant-plugin.xml
  • Loading branch information
DirkMahler committed Jul 1, 2014
2 parents 3678cc3 + 6b62060 commit 80ff8f9
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<configuration>
<schemaDirectory>src/main/resources/META-INF/xsd</schemaDirectory>
<bindingDirectory>src/main/resources/META-INF/bindings</bindingDirectory>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.buschmais.jqassistant.core.plugin.impl;

public class ClassNameFormatter {

/**
* Trim class names read from xml jqassistant-plugin.xml.
*
* @param value
* @return
*/
public static String parseClassName(String value) {
return value.trim();
}
}
33 changes: 33 additions & 0 deletions core/plugin/src/main/resources/META-INF/bindings/bindings.xjb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<jxb:bindings xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb" version="2.1">
<jxb:bindings schemaLocation="../xsd/jqassistant-plugin-1.0.xsd">
<jxb:bindings node="//xs:complexType[@name='ModelType']//xs:element[@name='class']">
<jxb:property name="class">
<jxb:baseType>
<jxb:javaType name="java.lang.String"
parseMethod="com.buschmais.jqassistant.core.plugin.impl.ClassNameFormatter.parseClassName"
printMethod="com.buschmais.jqassistant.core.plugin.impl.ClassNameFormatter.parseClassName" />
</jxb:baseType>
</jxb:property>
</jxb:bindings>
<jxb:bindings node="//xs:complexType[@name='ScannerType']//xs:element[@name='class']">
<jxb:property>
<jxb:baseType>
<jxb:javaType name="java.lang.String"
parseMethod="com.buschmais.jqassistant.core.plugin.impl.ClassNameFormatter.parseClassName"
printMethod="com.buschmais.jqassistant.core.plugin.impl.ClassNameFormatter.parseClassName" />
</jxb:baseType>
</jxb:property>
</jxb:bindings>
<jxb:bindings node="//xs:complexType[@name='ReportType']//xs:element[@name='class']">
<jxb:property>
<jxb:baseType>
<jxb:javaType name="java.lang.String"
parseMethod="com.buschmais.jqassistant.core.plugin.impl.ClassNameFormatter.parseClassName"
printMethod="com.buschmais.jqassistant.core.plugin.impl.ClassNameFormatter.parseClassName" />
</jxb:baseType>
</jxb:property>
</jxb:bindings>
</jxb:bindings>
</jxb:bindings>

0 comments on commit 80ff8f9

Please sign in to comment.