Skip to content

Commit

Permalink
sorting of regex results in pfile
Browse files Browse the repository at this point in the history
  • Loading branch information
cecom committed Dec 27, 2017
1 parent e1c0bbf commit 2195f9a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.geewhiz.pacify.model.PFile;
Expand Down Expand Up @@ -74,6 +75,8 @@ private List<PFile> resolveRegEx() {
result.add(pFile);
}

Collections.sort(result);

return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<Pacify xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="..\..\..\..\..\..\..\..\model\src\main\resources\pacify.xsd">
<Archive RelativePath="some.ear">
<Archive RelativePath="archive1.jar">
<File RelativePath="subfolder/archive1_conf2.txt">
<File RelativePath="archive1_conf1.txt">
<Property Name="foobar2"/>
<Property Name="someReference"/>
</File>
<File RelativePath="archive1_conf1.txt">
<File RelativePath="subfolder/archive1_conf2.txt">
<Property Name="foobar2"/>
<Property Name="someReference"/>
</File>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<Pacify xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="..\..\..\..\..\..\..\..\model\src\main\resources\pacify.xsd">
<Archive RelativePath="some.ear">
<Archive RelativePath="archive1.jar">
<File RelativePath="subfolder/archive1_conf2.txt">
<File RelativePath="archive1_conf1.txt">
<Property Name="wohooo"/>
</File>
<File RelativePath="archive1_conf1.txt">
<File RelativePath="subfolder/archive1_conf2.txt">
<Property Name="wohooo"/>
</File>
</Archive>
Expand Down
1 change: 1 addition & 0 deletions model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<arg>-XtoString</arg>
<arg>-Xannotate</arg>
<arg>-Xcopyable</arg>
<arg>-Xinject-code</arg>
</args>
</configuration>
<executions>
Expand Down
13 changes: 11 additions & 2 deletions model/src/main/resources/pacify.xjb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance" xmlns:annox="http://annox.dev.java.net" jaxb:extensionBindingPrefixes="inheritance xjc annox"
xmlns:inheritance="http://jaxb2-commons.dev.java.net/basic/inheritance" xmlns:annox="http://annox.dev.java.net" jaxb:extensionBindingPrefixes="inheritance xjc annox" xmlns:ci="http://jaxb.dev.java.net/plugin/code-injector"
jaxb:version="2.1">
>

<jaxb:bindings schemaLocation="pacify.xsd" node="/xsd:schema">

<jaxb:globalBindings>
Expand Down Expand Up @@ -30,7 +30,16 @@

<jaxb:bindings node="xsd:complexType[@name='PFile']">
<inheritance:extends>PFileBase</inheritance:extends>
<inheritance:implements><![CDATA[java.lang.Comparable<PFile>]]></inheritance:implements>
<ci:code>
<![CDATA[
public int compareTo(PFile other) {
return getRelativePath().compareTo(other.getRelativePath());
}
]]>
</ci:code>
</jaxb:bindings>

<jaxb:bindings node="xsd:complexType[@name='PFile']/*/xsd:element[@name='Property']">
<jaxb:property name="PProperties" />
</jaxb:bindings>
Expand Down

0 comments on commit 2195f9a

Please sign in to comment.