forked from BoD/android-contentprovider-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the ability to have constraints on entities. Sorry this breaks the
model json grammar.
- Loading branch information
Showing
9 changed files
with
148 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/java/org/jraf/androidcontentprovidergenerator/model/Constraint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* This source is part of the | ||
* _____ ___ ____ | ||
* __ / / _ \/ _ | / __/___ _______ _ | ||
* / // / , _/ __ |/ _/_/ _ \/ __/ _ `/ | ||
* \___/_/|_/_/ |_/_/ (_)___/_/ \_, / | ||
* /___/ | ||
* repository. | ||
* | ||
* Copyright 2013 Benoit 'BoD' Lubek (BoD@JRAF.org). All Rights Reserved. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.jraf.androidcontentprovidergenerator.model; | ||
|
||
public class Constraint { | ||
public static final String NAME = "name"; | ||
public static final String DEFINITION = "definition"; | ||
|
||
private final String mName; | ||
private final String mDefinition; | ||
|
||
public Constraint(String name, String definition) { | ||
mName = name.toLowerCase(); | ||
mDefinition = definition.toLowerCase(); | ||
} | ||
|
||
public String getNameUpperCase() { | ||
return mName.toUpperCase(); | ||
} | ||
|
||
public String getDefinitionUpperCase() { | ||
return mDefinition.toUpperCase(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Constraint [mName=" + mName + ", mDefinition=" + mDefinition + "]"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
src/main/resources/org/jraf/androidcontentprovidergenerator/columns.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters