diff --git a/.classpath b/.classpath
deleted file mode 100644
index 7b47d45..0000000
--- a/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- * Invólucro para exceções ocorridas no componente.
- *
- * Tipo de formatadores suportados. Usados junto a defini��o de novos
- * formatadores.
- *
- * Java class for enumFormatsTypes.
- *
- *
- * The following schema fragment specifies the expected content contained within
- * this class.
- *
- *
- *
- * Preenchimentos suportados por padr�o pelo componente.
- *
- * Java class for enumPaddings.
- *
- *
- * The following schema fragment specifies the expected content contained within
- * this class.
- *
- *
- *
- * Basicamente s�o defini��es de dire��es de escrita e leitura.
- *
- * Java class for enumSide.
- *
- *
- * The following schema fragment specifies the expected content contained within
- * this class.
- *
- *
- *
- * Para defini��o da posi��o.
- *
- * Informa a validade para a fixação de uma ou mais medidas. Exemplo:
- * > {
-
-}
diff --git a/src/br/com/nordestefomento/jrimum/texgit/engine/Builder4FlatFile.java b/src/br/com/nordestefomento/jrimum/texgit/engine/Builder4FlatFile.java
deleted file mode 100644
index 9d83b87..0000000
--- a/src/br/com/nordestefomento/jrimum/texgit/engine/Builder4FlatFile.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package br.com.nordestefomento.jrimum.texgit.engine;
-
-import static br.com.nordestefomento.jrimum.utilix.ObjectUtil.isNotNull;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import br.com.nordestefomento.jrimum.texgit.language.MetaFlatFile;
-import br.com.nordestefomento.jrimum.texgit.language.MetaRecord;
-import br.com.nordestefomento.jrimum.texgit.type.component.FlatFile;
-
-
-public class Builder4FlatFile {
-
- static FlatFile build(MetaFlatFile mFlatFile) {
-
- FlatFile ff = null;
-
- List
- * <simpleType name="enumFormatsTypes">
- * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- * <enumeration value="DATE"/>
- * <enumeration value="DECIMAL"/>
- * </restriction>
- * </simpleType>
- *
- *
- */
-@XmlEnum
-public enum EnumFormatsTypes {
-
- DATE, DECIMAL;
-
- public String value() {
- return name();
- }
-
- public static EnumFormatsTypes fromValue(String v) {
- return valueOf(v);
- }
-
-}
diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/EnumPaddings.java b/src/br/com/nordestefomento/jrimum/texgit/language/EnumPaddings.java
deleted file mode 100644
index 7e8ee89..0000000
--- a/src/br/com/nordestefomento/jrimum/texgit/language/EnumPaddings.java
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
-// See http://java.sun.com/xml/jaxb
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00
-//
-
-package br.com.nordestefomento.jrimum.texgit.language;
-
-import javax.xml.bind.annotation.XmlEnum;
-
-/**
- *
- *
- *
- * <simpleType name="enumPaddings">
- * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- * <enumeration value="ZERO_RIGHT"/>
- * <enumeration value="ZERO_LEFT"/>
- * <enumeration value="WHITE_SPACE_RIGHT"/>
- * <enumeration value="WHITE_SPACE_LEFT"/>
- * </restriction>
- * </simpleType>
- *
- *
- */
-@XmlEnum
-public enum EnumPaddings {
-
- ZERO_RIGHT, ZERO_LEFT, WHITE_SPACE_RIGHT, WHITE_SPACE_LEFT;
-
- public String value() {
- return name();
- }
-
- public static EnumPaddings fromValue(String v) {
- return valueOf(v);
- }
-
-}
diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/EnumSide.java b/src/br/com/nordestefomento/jrimum/texgit/language/EnumSide.java
deleted file mode 100644
index d55ba67..0000000
--- a/src/br/com/nordestefomento/jrimum/texgit/language/EnumSide.java
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
-// See http://java.sun.com/xml/jaxb
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00
-//
-
-package br.com.nordestefomento.jrimum.texgit.language;
-
-import javax.xml.bind.annotation.XmlEnum;
-
-/**
- *
- *
- *
- * <simpleType name="enumSide">
- * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- * <enumeration value="LEFT"/>
- * <enumeration value="RIGHT"/>
- * </restriction>
- * </simpleType>
- *
- *
- */
-@XmlEnum
-public enum EnumSide {
-
- LEFT, RIGHT;
-
- public String value() {
- return name();
- }
-
- public static EnumSide fromValue(String v) {
- return valueOf(v);
- }
-
-}
diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/MetaOrderedField.java b/src/br/com/nordestefomento/jrimum/texgit/language/MetaOrderedField.java
deleted file mode 100644
index 09a6290..0000000
--- a/src/br/com/nordestefomento/jrimum/texgit/language/MetaOrderedField.java
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
-// See http://java.sun.com/xml/jaxb
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00
-//
-
-package br.com.nordestefomento.jrimum.texgit.language;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- *
- *
- *
- *
- * {
- * isLenghtAsDefine();
- * isSizeAsDefine();
- * }
- *
- *
- * Tamanho da string de escrita do bloco. - *
- */ - private Integer instantLength; - - /** - * - */ - public BlockOfFields() { - super(); - } - - /** - * @param length - * @param size - */ - public BlockOfFields(Integer length, Integer size) { - - super(size); - - ObjectUtil.checkNotNull(length, "length"); - - if (length > 0) { - - setLength(length); - setSize(size); - - } else - throw new IllegalArgumentException("O comprimento do bloco [ " - + length + " ] deve ser um número natural > 0!"); - } - - @Override - public BlockOfFields clone() throws CloneNotSupportedException { - - return(BlockOfFields) super.clone(); - } - - @Override - public void read(String lineOfFields) { - - ObjectUtil.checkNotNull(lineOfFields, "lineOfFields"); - - ObjectUtil.checkNotNull(getFields(), "fields"); - - if (isSizeAsDefinaed() && isLengthWithDefinaed(lineOfFields.length())) { - - StringBuilder builder = new StringBuilder(lineOfFields); - - for (FixedField> field : getFields()) { - - field.read(builder.substring(0, field.getFixedLength())); - builder.delete(0, field.getFixedLength()); - } - - builder = null; - } - } - - @Override - public String write() { - - ObjectUtil.checkNotNull(getFields(), "fields"); - - String str = null; - - isSizeAsDefinaed(); - - str = super.write(); - - instantLength = str.length(); - - isFixedAsDefined(); - - return str; - } - - @Override - public boolean isFixedAsDefined() throws IllegalStateException { - - return (isSizeAsDefinaed() && isLengthWithDefinaed()); - } - - private boolean isLengthWithDefinaed(){ - - return isLengthWithDefinaed(instantLength); - } - - private boolean isLengthWithDefinaed(int length){ - - if(length == getFixedLength()) - return true; - else - throw new IllegalStateException("O comprimento da string [ " + instantLength + " ] é incompátivel com o definido ["+getFixedLength()+"]!"); - } - - private boolean isSizeAsDefinaed(){ - - if(size() == getFixedSize()) - return true; - else - throw new IllegalStateException("O número de fields [ " + size() + " ] é incompátivel com o definido ["+getFixedSize()+"]!"); - } - - /** - * @return the length - */ - public Integer getFixedLength() { - return length; - } - - /** - * @param length the length to set - */ - private void setLength(Integer length) { - - if (isNotNull(length)) - this.length = length; - else - throw new IllegalArgumentException("Comprimento inválido [" + length + "]!"); - } - - /** - * @return the size - */ - public Integer getFixedSize() { - return size; - } - - /** - * @param size the size to set - */ - private void setSize(Integer size) { - - if (isNotNull(size)) - this.size = size; - else - throw new IllegalArgumentException("Tamanho inválido [" + size + "]!"); - } -} diff --git a/src/br/com/nordestefomento/jrimum/texgit/type/component/CommonFiller.java b/src/br/com/nordestefomento/jrimum/texgit/type/component/CommonFiller.java deleted file mode 100644 index 981ca88..0000000 --- a/src/br/com/nordestefomento/jrimum/texgit/type/component/CommonFiller.java +++ /dev/null @@ -1,38 +0,0 @@ -package br.com.nordestefomento.jrimum.texgit.type.component; - -import br.com.nordestefomento.jrimum.utilix.StringUtil; - - -public enum CommonFiller { - - /** - * Filler padrão para preenchimento com zeros a esquerda. - */ - ZERO_LEFT(new Filler- *Nome do campo, também pode ser usado como id. - *
- */ - private String name; - - /** - *- * Valor do campo. - *
- */ - private G value; - - /** - *- * Formatador utilizado na leitura e escrita do valor do campo. - *
- */ - private Format formatter; - - /** - *- * Necessário para ler campos númericos em branco. - *
- */ - private boolean blankAccepted; - - /** - * - */ - public Field() { - super(); - } - - /** - * @param name - * @param value - */ - public Field(String name, G value) { - super(); - setName(name); - setValue(value); - } - - /** - *
- * Cria um Field com um valor e um formatador para o valor. Isto significa que a leitura e escrita do valor informado
- * será de acordo com o formatador.
- *
- * Cria um Field com nome para identificação, valor e um formatador.
- *
- * Tamanho de especificação e parâmetro da string de leitura ou escrita do campo. - *
- */ - private Integer length; - - /** - *- * Preenchedor do valor utilizado na hora da escrita. - *
- */ - private Filler> filler; - - - /** - *- * Tamanho da string de escrita do campo. - *
- */ - private Integer instantLength; - - - /** - * - */ - public FixedField() { - super(); - } - - /** - * @param ordem - * @param length - * @param filler - */ - public FixedField(String name, G value, Integer length, Filler> filler) { - super(name,value); - setFixedLength(length); - setFiller(filler); - } - - /** - * @param ordem - * @param length - * @param filler - */ - public FixedField(G value, Format formatter, Integer length, Filler> filler) { - super(value,formatter); - setFixedLength(length); - setFiller(filler); - } - - /** - * @param ordem - * @param length - * @param filler - */ - public FixedField(String name, G value, Format formatter, Integer length, Filler> filler) { - super(name,value,formatter); - setFixedLength(length); - setFiller(filler); - } - - @Override - public FixedField- * Lados para alinhar campos, preenchimento ou orientações em geral. - *
- */ -public enum Side { - - LEFT, - - RIGHT; -} diff --git a/src/br/com/nordestefomento/jrimum/texgit/util/FileUtil.java b/src/br/com/nordestefomento/jrimum/texgit/util/FileUtil.java deleted file mode 100644 index d740a77..0000000 --- a/src/br/com/nordestefomento/jrimum/texgit/util/FileUtil.java +++ /dev/null @@ -1,355 +0,0 @@ -package br.com.nordestefomento.jrimum.texgit.util; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang.StringUtils; - - -/** - * - *- * DEFINIÇÃO DA CLASSE - *
- * - *- * OBJETIVO/PROPÓSITO - *
- * - *- * EXEMPLO: - *
- * - * @author Gilmar P.S.L. - * - * @since - * - * @version - */ - -public class FileUtil { - - public static final String ENTER = "\r\n"; - - - - /** - *- * Método responsável pela leitura de qualqer arquivo. Cada linha do arquivo - * corresponde a um item da lista retornada. Caso tenha lido algum arquivo - * ou não houve poblema na leitura, retorna List senão null - *
- * - * @param pathName - * @return sucess - * - * @since - */ - - public static List- * Método responável pela leitura de qualqer arquivo. Cada linha do arquivo - * corresponde a um item da lista retornada. Caso tenha lido algum arquivo - * ou não houve poblema na leitura, retorna List senão null. - *
- * - * @param file - * @return - * - * @since - */ - - public static List- * Método responsável pela marcação de qualqer arquivo. - *
- * - * @param pathName - * @param tag - * @return sucess - * - * @since - */ - - public static boolean mark(String pathName, String tag) { - - if (pathName != null & tag != null) { - - File arch = new File(pathName); - File newArch = new File(pathName + tag); - - arch.renameTo(newArch); - - return true; - } - return false; - } - - - - /** - *- * Método responsável pela renomeação de qualqer arquivo - *
- * - * @param pathDir - * @param name - * @param wishName - * @return sucess - * - * @since - */ - - public static boolean renameAs(String pathDir, String name, - String wishName) { - - if (pathDir != null & name != null & wishName != null) { - - File arch = new File(pathDir + "/" + name); - File newArch = new File(pathDir + "/" + wishName); - - arch.renameTo(newArch); - - return true; - } - - return false; - } - - - - /** - *- * Cria um arquivo a partir de uma única string com o layout da mesma. Ou - * seja, se a string tem quebra de linha o arquivo também terá. - *
- * - * @param path - * @param content - * @return sucess - * - * @since - */ - - public static boolean createFile(String path, String content) { - - try { - - File arch = null; - - arch = new File(path); - - BufferedWriter wtr = new BufferedWriter(new FileWriter(arch)); - wtr.write(content); - wtr.flush(); - wtr.close(); - - arch.setWritable(true); - arch.setReadable(true); - arch.setExecutable(true); - - return true; - - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - - return false; - - } - - - /** - *- * Cria um arquivo com várias linhas a partir de uma lista de strings. Para - * cada item da lista uma linha será criada no arquivo. - *
- * - * @param path - * @param content - * - * @since - */ - - public static void createFile(String path, List- * Cria um arquivo com vária linhas a partir de uma lista de strings. Para - * cada item da lista uma linha será criada no arquivo. - *
- * - * @param file - * @param content - * - * @since - */ - - public static void write(File file, List- * Cria um arquivo a partir de uma única string. - *
- * - * @param file - * @param content - * - * @since - */ - - public static void write(File file, String content) { - - try { - - BufferedWriter wtr = new BufferedWriter(new FileWriter(file)); - - wtr.write(content); - - wtr.flush(); - wtr.close(); - - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - -} diff --git a/src/br/com/nordestefomento/jrimum/utilix/DateUtil.java b/src/br/com/nordestefomento/jrimum/utilix/DateUtil.java deleted file mode 100644 index 322bc1c..0000000 --- a/src/br/com/nordestefomento/jrimum/utilix/DateUtil.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright 2008 JRimum Project - * - * 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. - * - * Created at: 30/03/2008 - 18:17:40 - * - * ================================================================================ - * - * Direitos autorais 2008 JRimum Project - * - * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar - * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma - * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que - * haja exigência legal ou acordo por escrito, a distribuição de software sob - * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER - * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a - * reger permissões e limitações sob esta LICENÇA. - * - * Criado em: 30/03/2008 - 18:17:40 - * - */ - -package br.com.nordestefomento.jrimum.utilix; - -import static br.com.nordestefomento.jrimum.utilix.ObjectUtil.isNotNull; - -import java.io.Serializable; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; - -import org.apache.commons.lang.time.DateUtils; - -/** - * - *
- * Serviços utilitários relacionados a manipulação de Objetos
- * Date, Calendar, GregorianCalendar.
- *
- * Formatador de datas no padrão dd/MM/yyyy. - *
- */ - public static final DateFormat FORMAT_DD_MM_YYYY = new SimpleDateFormat( - "dd/MM/yyyy"); - - /** - *- * Formatador de datas no padrão ddMMyy. - *
- */ - public static final DateFormat FORMAT_DDMMYY = new SimpleDateFormat( - "ddMMyy"); - - /** - *- * Formatador de datas no padrão yyMMdd. - *
- */ - public static final DateFormat FORMAT_YYMMDD = new SimpleDateFormat( - "yyMMdd"); - - /** - *
- * Representa uma data inexistente, pode ser usada em casos que não se pode
- * usar null [ é obtida da seguinte forma:
- * new GregorianCalendar(1, 0, 1).getTime() ]
- *
- * Converte um objeto String em um objeto
- * java.util.Date no formato de data padrão brasileiro:
- * dd/MM/yyyy.
- *
- * Utiliza a sobrecarca
- * parse(String dateAsString, DateFormat dateFormat) para
- * realizar a conversão.
- *
String.
- * @return Objeto java.util.Date convertido a partir do objeto
- * String
- *
- * @throws IllegalArgumentException
- * caso o objeto String não seja um valor válido de
- * data suportado pelo formato.
- * @since 0.2
- */
- public static Date parse(String dateAsString) {
-
- return parse(dateAsString, FORMAT_DD_MM_YYYY);
- }
-
- /**
- *
- * Converte um objeto String em um objeto
- * java.util.Date a partir do formato de data especificado.
- *
- * Utiliza a sobrecarca
- * parse(String dateAsString, DateFormat dateFormat) para
- * realizar a conversão.
- *
String.
- * @param dateFormat
- * - formato de data
- * @return Objeto java.util.Date convertido a partir do objeto
- * String
- *
- * @throws IllegalArgumentException
- * caso o objeto String não seja um valor válido de
- * data suportado pelo formato.
- * @since 0.2
- */
- public static Date parse(String dateAsString, String dateFormat) {
-
- if (dateFormat == null) {
- throw new NullPointerException(
- "O formato da data não pode ter valor [null].");
- }
-
- return parse(dateAsString, new SimpleDateFormat(dateFormat));
- }
-
- /**
- *
- * Converte um objeto String em um objeto
- * java.util.Date através do objeto
- * java.text.DateFormat especificado.
- *
String.
- * @param dateFormat
- * - formatador para objetos java.util.Date.
- * @return Objeto java.util.Date convertido a partir do objeto
- * String
- *
- * @throws IllegalArgumentException
- * caso o objeto String não seja um valor válido de
- * data suportado pelo formatador.
- * @since 0.2
- */
- public static Date parse(String dateAsString, DateFormat dateFormat) {
-
- Date date = null;
-
- if (dateAsString == null) {
- throw new NullPointerException(
- "A String a ser convertida não pode ter valor [null].");
- }
-
- if (dateFormat == null) {
- throw new NullPointerException(
- "O formatador não pode ter valor [null].");
- }
-
- try {
-
- date = dateFormat.parse(dateAsString);
-
- } catch (ParseException e) {
-
- String msg = "A String [" + dateAsString
- + "] deve ser uma data válida no formato";
- if (dateFormat instanceof SimpleDateFormat) {
- SimpleDateFormat sdf = (SimpleDateFormat) dateFormat;
- msg += " [" + sdf.toPattern() + "].";
-
- } else {
- msg += " especificado.";
- }
-
- IllegalArgumentException iae = new IllegalArgumentException(msg);
- iae.initCause(e);
- throw iae;
- }
-
- return date;
- }
-
- /**
- * - * Calcula a diferença de dias entre duas datas. O resultado é modular, ou - * seja, maior ou igual a zero, logo a data final não precisa ser - * necessariamente maior que a data inicial. - *
- * - * @param dataInicial - * - data inicial do intervalo. - * @param dataFinal - * - data final do intervalo. - * @return número(módulo) de dias entre as datas. - * - * @throws IllegalArgumentException - * Caso pelo menos uma das duas datas sejanull.
- * @since 0.2
- */
- public static long calculeDiferencaEmDias(final Date dataInicial,
- final Date dataFinal) {
-
- long fator = 0;
- Date dataInicialTruncada, dataFinalTruncada;
-
- if (isNotNull(dataInicial) && isNotNull(dataFinal)) {
-
- dataInicialTruncada = DateUtils
- .truncate(dataInicial, Calendar.DATE);
- dataFinalTruncada = DateUtils.truncate(dataFinal, Calendar.DATE);
-
- fator = ((dataFinalTruncada.getTime() - dataInicialTruncada
- .getTime()) / DateUtils.MILLIS_PER_DAY);
-
- if (fator < 0) {
- fator *= -1;
- }
- } else {
- throw new IllegalArgumentException("A data inicial [" + dataInicial
- + "] e a data final [" + dataFinal + "] "
- + "não podem ter valor 'null'.");
- }
-
- return fator;
- }
-
-}
diff --git a/src/br/com/nordestefomento/jrimum/utilix/ObjectUtil.java b/src/br/com/nordestefomento/jrimum/utilix/ObjectUtil.java
deleted file mode 100644
index 949cf11..0000000
--- a/src/br/com/nordestefomento/jrimum/utilix/ObjectUtil.java
+++ /dev/null
@@ -1,624 +0,0 @@
-/*
- * Copyright 2008 JRimum Project
- *
- * 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.
- *
- * Created at: 30/03/2008 - 18:02:40
- *
- * ================================================================================
- *
- * Direitos autorais 2008 JRimum Project
- *
- * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar
- * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma
- * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que
- * haja exigência legal ou acordo por escrito, a distribuição de software sob
- * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER
- * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a
- * reger permissões e limitações sob esta LICENÇA.
- *
- * Criado em: 30/03/2008 - 18:02:40
- *
- */
-
-package br.com.nordestefomento.jrimum.utilix;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Map;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.log4j.Logger;
-
-/**
- * - * Classe utilitária para validações de objetos em geral, como verificações - * de objetos nulos, coleções/arrays vazios. - *
- *- * Fornece métodos booleanos e métodos que verificam se o valor do objeto está de acordo - * com o desejado e, caso não estejam, lançam exceção. - *
- * - * @author Gilmar P.S.L. - * @author Rômulo Augusto - * - * @since 0.2 - * - * @version 0.2 - */ -public class ObjectUtil implements Serializable { - - private static final long serialVersionUID = -6790981191128287923L; - - private static Logger log = Logger.getLogger(ObjectUtil.class); - - /** - * Construtor privado para previnir a instanciação. - * - * @throws AssertionError caso haja alguma tentativa de utilização deste construtor. - */ - private ObjectUtil() { - throw new AssertionError(); - } - - /** - *- * Método privado para fins de reutilização de código. Deve ser utilizado para verificar se - * coleções ou mapas são vazios. - *
- *
- * Verifica se o objeto passado por parâmetro é null ou se tem tamanho zero. Para verificar
- * o tamanho, primeiro realiza um "cast" para Collection, caso seja instância de Collection,
- * ou para Map, caso seja instância de Map, e utiliza o método "size()".
- *
- * Método privado para fins de reutilização de código. Deve ser utilizado para verificar se - * coleções ou mapas são vazios. - *
- *
- * Verifica se o objeto passado por parâmetro é null ou se tem tamanho zero.
- * Para verificar o tamanho, primeiro realiza um "cast" para Collection, caso seja instância de Collection,
- * ou para Map, caso seja instância de Map, e utiliza o método "size()".
- *
- * Método privado para fins de reutilização de código. Deve ser utilizado para verificar se - * coleções ou mapas não são vazios. - *
- *
- * Verifica se o objeto passado por parâmetro não é null ou se tem tamanho zero.
- * Para verificar o tamanho, primeiro realiza um "cast" para Collection, caso seja instância de Collection,
- * ou para Map, caso seja instância de Map, e utiliza o método "size()".
- *
- * Caso o objeto seja null, lança NullPointerException com a mensagem informada no
- * parâmetro messageNullPointer (primeiro parâmetro String). Caso o objeto não seja
- * null e não possua elementos, lança IllegalArgumentException com a mensagem
- * informada no parâmetro messageIllegalArgument (segundo parâmetro String).
- *
NullPointerException
- * @param messageIllegalArgument - Mensagem utiliada na exceção IllegalArgumentException
- */
- private static void checkNotEmpty(Object object, String messageNullPointer, String messageIllegalArgument) {
-
- if (isNull(object)) {
- throw new NullPointerException(messageNullPointer);
- }
-
- if (isEmpty(object)) {
- throw new IllegalArgumentException(messageIllegalArgument);
- }
- }
-
- /**
- * - * Verifica a referência ao objeto e lança uma exceção para casos onde a - * referência é nula incluíndo na mensagem de exceção o nome do parâmetro - * passado. - *
- * - * @param object - * @param name - * - * @return (object == null ? true : false) - * - * @throws IllegalArgumentException - * - * @see #isNotNull(Object, String) - * - * @since 0.2 - */ - @Deprecated - public static boolean isNull(Object object, String name) throws IllegalArgumentException { - - boolean is = true; - - if (object != null) { - is = false; - - } else { - - IllegalArgumentException e = new IllegalArgumentException( - (name != null ? name : "Objeto ") + " inválido : [" - + object + "]!"); - - log.error(StringUtils.EMPTY, e); - - throw e; - } - - return is; - } - - /** - *- * Verifica a referência ao objeto e lança uma exceção para casos onde a - * referência é nula incluíndo na mensagem de exceção o nome do parâmetro - * passado. - *
- * - *
- * É o mesmo que usar !isNull(obj1,"obj1") a diferença é que
- * utiliza-se um símbolo ! a menos.
- *
- * Verifica se o objeto passado por parâmetro é null.
- *
- * Verifica se o objeto passado por parâmetro não é null.
- *
- * É o mesmo que usar o método isNull da forma !isNull(obj), porém
- * de forma mais legível.
- *
- * Verifica se existe uma referência ao objeto dado. - *
- * - * @param object - Objeto analisado - * - * @return (object != null ? true : false) - * - * @see #isNotNull(Object) - * - * @since 0.2 - */ - public static boolean exists(Object object) { - return isNotNull(object); - } - - /** - *
- * Verifica se a Collection passada por parâmetro é null ou
- * não possui elementos.
- *
Collection analisada
- * @return (collection == null || collection.size() == 0 ? true : false)
- *
- * @since 0.2
- */
- public static boolean isEmpty(Collection> collection) {
- return isEmpty((Object) collection);
- }
-
- /**
- *
- * Verifica se a Collection passada por parâmetro não é null
- * e possui elementos.
- *
Collection analisada
- * @return (collection != null && collection.size() > 0 ? true : false)
- *
- * @see #isEmpty(Collection)
- *
- * @since 0.2
- */
- public static boolean isNotEmpty(Collection> collection) {
- return isNotEmpty((Object) collection);
- }
-
- /**
- *
- * Verifica se o Map passado por parâmetro é null ou
- * não possui elementos.
- *
Map analisada
- * @return (map == null || map.size() == 0 ? true : false)
- *
- * @since 0.2
- */
- public static boolean isEmpty(Map, ?> map) {
- return isEmpty((Object) map);
- }
-
- /**
- *
- * Verifica se o Map passado por parâmetro não é null
- * e possui elementos.
- *
Map analisada
- * @return (map != null && map.size() > 0 ? true : false)
- *
- * @see #isEmpty(Map)
- *
- * @since 0.2
- */
- public static boolean isNotEmpty(Map, ?> map) {
- return isNotEmpty((Object) map);
- }
-
- /**
- * - * Método privado para fins de reutilização de código. Deve ser utilizado para verificar se - * coleções ou mapas não são vazios. - *
- *
- * Verifica se o objeto passado por parâmetro não é null ou se tem tamanho zero.
- * Para verificar o tamanho, primeiro realiza um "cast" para Collection, caso seja instância de Collection,
- * ou para Map, caso seja instância de Map, e utiliza o método "size()".
- *
- * Verifica se o objeto é nulo e lança IllegalArgumentException, com a mensagem
- * informada, caso não seja.
- *
null.
- *
- * @see #isNull(Object)
- * @see #isNotNull(Object)
- *
- * @since 0.2
- *
- * @param object - Objeto analisado
- * @param message - Mensagem utilizada na exceção
- */
- public static void checkNull(Object object, String message) {
-
- if (isNotNull(object)) {
- throw new IllegalArgumentException(message);
- }
- }
-
- /**
- *
- * Verifica se o objeto é nulo e lança IllegalArgumentException caso
- * não seja.
- *
null.
- *
- * @see #checkNull(Object, String)
- * @see #isNull(Object)
- * @see #isNotNull(Object)
- *
- * @since 0.2
- */
- public static void checkNull(Object object) {
- checkNull(object, "Objeto não nulo. Valor [" + object + "]");
- }
-
- /**
- *
- * Verifica se o objeto não é nulo e lança NullPointerException, com
- * a mensagem informada, caso seja.
- *
null.
- *
- * @see #isNull(Object)
- * @see #isNotNull(Object)
- *
- * @since 0.2
- */
- public static void checkNotNull(Object object, String message) {
-
- if (isNull(object)) {
- throw new NullPointerException(message);
- }
- }
-
- /**
- *
- * Verifica se o objeto não é nulo e lança NullPointerException
- * caso seja.
- *
null.
- *
- * @see #checkNotNull(Object, String)
- * @see #isNull(Object)
- * @see #isNotNull(Object)
- *
- * @since 0.2
- */
- public static void checkNotNull(Object object) {
- checkNotNull(object, "Objeto nulo");
- }
-
- /**
- *
- * Verifica se a Collection passado por parâmetro é null ou
- * não possui elementos e lança exceção, com a mensagem informada,
- * caso não preencha estes requisitos.
- *
Collection analisada
- * @param message - Mensagem utilizada na exceção
- *
- * @thows IllegalArgumentException - Caso a coleção não seja null e possua elementos.
- *
- * @see #isEmpty(Collection)
- * @see #isNotEmpty(Collection)
- *
- * @since 0.2
- */
- public static void checkEmpty(Collection> collection, String message) {
- checkEmpty((Object) collection, message);
- }
-
- /**
- *
- * Verifica se a Collection passada por parâmetro é null ou
- * não possui elementos e lança exceção caso não preencha estes requisitos.
- *
Collection analisada
- *
- * @thows IllegalArgumentException - Caso a coleção não seja null e possua elementos.
- *
- * @see #checkEmpty(Collection, String)
- * @see #isEmpty(Collection)
- * @see #isNotEmpty(Collection)
- *
- * @since 0.2
- */
- public static void checkEmpty(Collection> collection) {
- checkEmpty(collection, "Collection não nulo e com elementos. Valor [" + collection + "]");
- }
-
- /**
- *
- * Verifica se a Collection passada por parâmetro não é null e
- * possui elementos e lança exceção, com a mensagem informada, caso não preencha estes requisitos.
- *
Collection analisada
- * @param message - Mensagem utiliada na exceção
- *
- * @throws NullPointerException - Caso a coleção seja null.
- * @thows IllegalArgumentException - Caso a coleção não possua elementos.
- *
- * @see #isEmpty(Collection)
- * @see #isNotEmpty(Collection)
- *
- * @since 0.2
- */
- public static void checkNotEmpty(Collection> collection, String message) {
- checkNotEmpty(collection, message, message);
- }
-
- /**
- *
- * Verifica se a Collection passada por parâmetro não é null e
- * possui elementos e lança exceção caso não preencha estes requisitos.
- *
Collection analisada
- *
- * @throws NullPointerException - Caso a coleção seja null.
- * @thows IllegalArgumentException - Caso a coleção não possua elementos.
- *
- * @see #checkNotEmpty(Collection, String)
- * @see #isEmpty(Collection)
- * @see #isNotEmpty(Collection)
- *
- * @since 0.2
- */
- public static void checkNotEmpty(Collection> collection) {
- checkNotEmpty(collection, "Objeto nulo", "Collection sem elementos");
- }
-
- /**
- *
- * Verifica se o Map passado por parâmetro é null ou
- * não possui elementos e lança exceção, com a mensagem informada,
- * caso não preencha estes requisitos.
- *
Map analisada
- * @param message - Mensagem utilizada na exceção
- *
- * @thows IllegalArgumentException - Caso o mapa não seja null e possua elementos.
- *
- * @see #isEmpty(Map)
- * @see #isNotEmpty(Map)
- *
- * @since 0.2
- */
- public static void checkEmpty(Map, ?> map, String message) {
- checkEmpty((Object) map, message);
- }
-
- /**
- *
- * Verifica se o Map passado por parâmetro é null ou
- * não possui elementos e lança exceção caso não preencha estes requisitos.
- *
Map analisada
- *
- * @thows IllegalArgumentException - Caso o mapa não seja null e possua elementos.
- *
- * @see #checkEmpty(Map, String)
- * @see #isEmpty(Map)
- * @see #isNotEmpty(Map)
- *
- * @since 0.2
- */
- public static void checkEmpty(Map, ?> map) {
- checkEmpty(map, "Map não nulo e com elementos. Valor [" + map + "]");
- }
-
- /**
- *
- * Verifica se o Map passado por parâmetro não é null e
- * possui elementos e lança exceção, com a mensagem informada, caso não preencha estes requisitos.
- *
Map analisada
- * @param message - Mensagem utiliada na exceção
- *
- * @throws NullPointerException - Caso o mapa seja null.
- * @thows IllegalArgumentException - Caso o mapa não possua elementos.
- *
- * @see #isEmpty(Map)
- * @see #isNotEmpty(Map)
- *
- * @since 0.2
- */
- public static void checkNotEmpty(Map, ?> map, String message) {
- checkNotEmpty(map, message, message);
- }
-
- /**
- *
- * Verifica se o Map passado por parâmetro não é null e
- * possui elementos e lança exceção caso não preencha estes requisitos.
- *
Map analisada
- *
- * @throws NullPointerException - Caso o mapa seja null.
- * @thows IllegalArgumentException - Caso o mapa não possua elementos.
- *
- * @see #checkNotEmpty(Map, String)
- * @see #isEmpty(Map)
- * @see #isNotEmpty(Map)
- *
- * @since 0.2
- */
- public static void checkNotEmpty(Map, ?> map) {
- checkNotEmpty(map, "Objeto nulo", "Map sem elementos");
- }
-
- /**
- * Exibe os valores de instância para um objeto JRimum.
- *
- * @see org.apache.commons.lang.builder.ToStringBuilder#reflectionToString
- *
- * @since 0.2
- *
- * @see java.lang.Object#toString()
- */
- public static String toString(Object obj) {
- return "JRimumObject: " + ToStringBuilder.reflectionToString(obj);
- }
-}
diff --git a/src/br/com/nordestefomento/jrimum/utilix/StringUtil.java b/src/br/com/nordestefomento/jrimum/utilix/StringUtil.java
deleted file mode 100644
index f28a5bc..0000000
--- a/src/br/com/nordestefomento/jrimum/utilix/StringUtil.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * Copyright 2008 JRimum Project
- *
- * 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.
- *
- * Created at: 30/03/2008 - 18:18:19
- *
- * ================================================================================
- *
- * Direitos autorais 2008 JRimum Project
- *
- * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar
- * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma
- * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que
- * haja exigência legal ou acordo por escrito, a distribuição de software sob
- * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER
- * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a
- * reger permissões e limitações sob esta LICENÇA.
- *
- * Criado em: 30/03/2008 - 18:18:19
- *
- */
-
-package br.com.nordestefomento.jrimum.utilix;
-
-import static br.com.nordestefomento.jrimum.utilix.ObjectUtil.isNotNull;
-
-import java.io.Serializable;
-
-import org.apache.commons.lang.StringUtils;
-
-/**
- *
- * Esta classe tem a responsabilidade de prover serviços utilitários
- * relacionados a manipulação de Strings
- *
- * Construtor privado que previne a instanciação da classe até por - * reflection - *
- * - * @since 0.2 - */ - private StringUtil() { - throw new AssertionError(); - } - - /** - *- * Método privado para fins de reutilização de código. - *
- *
- * Verifica se a String passada por parâmetro não é null,
- * não é vazia (StringUtils.EMPTY) e não possui apenas espaços em branco.
- *
- * Lança NullPointerException, com a mensagem definida em messageNullPointer
- * (segundo parâmetro String), caso o valor passado seja null
- *
- * Lança IllegalArgumentException, com a mensagem definida em messageIllegalArgument
- * (terceiro parâmetro String), caso o valor passado seja vazio ou contenha apenas espaços em branco.
- *
null.
- * @thows IllegalArgumentException - Caso a string seja vazia ou contenha apenas espaços em branco.
- *
- * @since 0.2
- */
- private static void checkNotBlank(String value, String messageNullPointer, String messageIllegalArgument) {
-
- ObjectUtil.checkNotNull(value, messageNullPointer);
-
- if (StringUtils.isBlank(value)) {
- throw new IllegalArgumentException(messageIllegalArgument);
- }
- }
-
- /**
- * - * Elimina simbolos como:
><,;.:!*&%+-_<>[]\/- * - * - * @param str - * String com os símbolos a serem removidos. - * @return String sem símbolos. - * @since 0.2 - */ - public static String eliminateSymbols(final String str) { - - String modifiedStr = str; - - if (isNotNull(modifiedStr)) { - - modifiedStr = StringUtils.replace(str, "-", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "_", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "=", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "+", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "%", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "*", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "@", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "#", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "&", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, ":", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, ".", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, ";", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, ",", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "!", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "?", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "(", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, ")", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "{", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "}", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "[", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "]", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "/", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "\\", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, ">", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "<", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "\"", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "'", StringUtils.EMPTY); - modifiedStr = StringUtils.replace(str, "`", StringUtils.EMPTY); - } - - return modifiedStr; - } - - /** - *
- * Remove os zeros iniciais de uma String, seja ela numérica ou
- * não.
- *
- * removeStartWithZeros("00000") => 0
- * removeStartWithZeros("00023") => 23
- * removeStartWithZeros("02003") => 2003
- *
- * - * @param str - * @return a string sem zeros inicias ou um único zero. - * - * @since 0.2 - */ - - public static String removeStartWithZeros(final String str) { - - String withoutZeros = StringUtils.EMPTY; - final String zero = "0"; - - if (isNotNull(str)) { - - if (StringUtils.startsWith(str, zero)) { - - withoutZeros = StringUtils.removeStart(str, zero); - - while (StringUtils.startsWith(withoutZeros, zero)) { - withoutZeros = StringUtils.removeStart(withoutZeros, zero); - } - - if (withoutZeros.trim().length() == 0) { - withoutZeros = zero; - } - - } else { - withoutZeros = str; - } - } - - return withoutZeros; - } - - /** - *
- * Remove a acentuação do texto, que inclui os acentos: - *
- * Os acentos são removidos tanto para letras minúsculas como para letras - * maiúsculas. - *
- * - * @param value - * String com os caracteres a serem removidos. - * @return String sem acentuação. - * @since 0.2 - */ - public static String eliminateAccent(final String value) { - - String modifiedValue = value; - - // Para ç e Ç - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00E7', 'c'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00C7', 'C'); - - // Para à, á, â, ã e ä - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00E0', 'a'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00E1', 'a'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00E2', 'a'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00E3', 'a'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00E4', 'a'); - - // Para è, é, ê e ë - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00E8', 'e'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00E9', 'e'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00EA', 'e'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00EB', 'e'); - - // Para ì, í, î e ï - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00EC', 'i'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00ED', 'i'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00EE', 'i'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00EF', 'i'); - - // Para ò, ó, ô, õ e ö - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00F2', 'o'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00F3', 'o'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00F4', 'o'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00F5', 'o'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00F6', 'o'); - - // Para ù, ú, û e ü - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00F9', 'u'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00FA', 'u'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00FB', 'u'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00FC', 'u'); - - // Para À, Á, Â, Ã e Ä - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00C0', 'A'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00C1', 'A'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00C2', 'A'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00C3', 'A'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00C4', 'A'); - - // Para È, É, Ê e Ë - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00C8', 'E'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00C9', 'E'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00CA', 'E'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00CB', 'E'); - - // Para Ì, Í, Î e Ï - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00CC', 'I'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00CD', 'I'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00CE', 'I'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00CF', 'I'); - - // Para Ò, Ó, Ô, Õ e Ö - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00D2', 'O'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00D3', 'O'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00D4', 'O'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00D5', 'O'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00D6', 'O'); - - // Para Ù, Ú, Û e Ü - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00D9', 'U'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00DA', 'U'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00DB', 'U'); - modifiedValue = StringUtils.replaceChars(modifiedValue, '\u00DC', 'U'); - - return modifiedValue; - } - - /** - *
- * Verifica se a String passada por parâmetro não é null,
- * não é vazia (StringUtils.EMPTY) e não possui apenas espaços em branco.
- *
- * Lança exceção, com a mensagem passada por parâmetro (segundo parâmetro String), - * caso não preencha estes requisitos. - *
- * - * @param value - String analisada - * - * @throws NullPointerException - Caso a string sejanull.
- * @thows IllegalArgumentException - Caso a string seja vazia ou contenha apenas espaços em branco.
- *
- * @since 0.2
- */
- public static void checkNotBlank(String value, String message) {
- checkNotBlank(value, message, message);
- }
-
- /**
- *
- * Verifica se a String passada por parâmetro não é null,
- * não é vazia (StringUtils.EMPTY) e não possui apenas espaços em branco.
- * Lança exceção caso não preencha estes requisitos.
- *
null.
- * @thows IllegalArgumentException - Caso a string seja vazia ou contenha apenas espaços em branco.
- *
- * @since 0.2
- */
- public static void checkNotBlank(String value) {
- checkNotBlank(value, "String nula", "Valor inválido. String vazia ou contendo apenas espaços em brancos");
- }
-}
diff --git a/src/main/assembly/jrimum-texgit-examples.xml b/src/main/assembly/jrimum-texgit-examples.xml
new file mode 100644
index 0000000..4b921d4
--- /dev/null
+++ b/src/main/assembly/jrimum-texgit-examples.xml
@@ -0,0 +1,27 @@
+
* Interface genérica e representativa de coisas que necessitam de operações de
* fluxo de escrita e leitura.
@@ -44,7 +43,6 @@
*
* @version 0.2
*/
-
public interface ReadWriteStream
* Lê o tipo informado.
*
+ * Invólucro para exceções ocorridas no componente.
+ * Interface usada para objetos com serviços de leitura e escrita de textos.
+ * Tipo de formatadores suportados. Usados junto a defini��o de novos
+ * formatadores.
+ *
+ * Java class for enumFormatsTypes.
+ *
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ *
+ *
+ * Preenchimentos suportados por padr�o pelo componente.
+ *
+ * Java class for enumPaddings.
+ *
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ *
+ *
+ * Basicamente s�o defini��es de dire��es de escrita e leitura.
+ *
+ * Java class for enumSide.
+ *
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ *
+ * > {
+
+}
diff --git a/src/br/com/nordestefomento/jrimum/utilix/TextStream.java b/src/main/java/org/jrimum/texgit/TextStream.java
similarity index 85%
rename from src/br/com/nordestefomento/jrimum/utilix/TextStream.java
rename to src/main/java/org/jrimum/texgit/TextStream.java
index 36b5f27..a37cced 100644
--- a/src/br/com/nordestefomento/jrimum/utilix/TextStream.java
+++ b/src/main/java/org/jrimum/texgit/TextStream.java
@@ -27,18 +27,16 @@
*
*/
+package org.jrimum.texgit;
-package br.com.nordestefomento.jrimum.utilix;
/**
- *
*
+ * <simpleType name="enumFormatsTypes">
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ * <enumeration value="DATE"/>
+ * <enumeration value="DECIMAL"/>
+ * </restriction>
+ * </simpleType>
+ *
+ *
+ */
+@XmlEnum
+public enum EnumFormatsTypes {
+
+ DATE, DECIMAL;
+
+ public String value() {
+ return name();
+ }
+
+ public static EnumFormatsTypes fromValue(String v) {
+ return valueOf(v);
+ }
+
+}
diff --git a/src/main/java/org/jrimum/texgit/language/EnumPaddings.java b/src/main/java/org/jrimum/texgit/language/EnumPaddings.java
new file mode 100644
index 0000000..33587c5
--- /dev/null
+++ b/src/main/java/org/jrimum/texgit/language/EnumPaddings.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2008 JRimum Project
+ *
+ * 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.
+ *
+ * Created at: 03/08/2008 - 12:27:56
+ *
+ * ================================================================================
+ *
+ * Direitos autorais 2008 JRimum Project
+ *
+ * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar
+ * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma
+ * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que
+ * haja exigência legal ou acordo por escrito, a distribuição de software sob
+ * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER
+ * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a
+ * reger permissões e limitações sob esta LICENÇA.
+ *
+ * Criado em: 03/08/2008 - 12:27:56
+ *
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
+// See http://java.sun.com/xml/jaxb
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00
+//
+
+package org.jrimum.texgit.language;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ *
+ *
+ *
+ * <simpleType name="enumPaddings">
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ * <enumeration value="ZERO_RIGHT"/>
+ * <enumeration value="ZERO_LEFT"/>
+ * <enumeration value="WHITE_SPACE_RIGHT"/>
+ * <enumeration value="WHITE_SPACE_LEFT"/>
+ * </restriction>
+ * </simpleType>
+ *
+ *
+ */
+@XmlEnum
+public enum EnumPaddings {
+
+ ZERO_RIGHT, ZERO_LEFT, WHITE_SPACE_RIGHT, WHITE_SPACE_LEFT;
+
+ public String value() {
+ return name();
+ }
+
+ public static EnumPaddings fromValue(String v) {
+ return valueOf(v);
+ }
+
+}
diff --git a/src/main/java/org/jrimum/texgit/language/EnumSide.java b/src/main/java/org/jrimum/texgit/language/EnumSide.java
new file mode 100644
index 0000000..32ba029
--- /dev/null
+++ b/src/main/java/org/jrimum/texgit/language/EnumSide.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2008 JRimum Project
+ *
+ * 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.
+ *
+ * Created at: 03/08/2008 - 12:27:56
+ *
+ * ================================================================================
+ *
+ * Direitos autorais 2008 JRimum Project
+ *
+ * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar
+ * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma
+ * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que
+ * haja exigência legal ou acordo por escrito, a distribuição de software sob
+ * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER
+ * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a
+ * reger permissões e limitações sob esta LICENÇA.
+ *
+ * Criado em: 03/08/2008 - 12:27:56
+ *
+ */
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
+// See http://java.sun.com/xml/jaxb
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00
+//
+
+package org.jrimum.texgit.language;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ *
+ *
+ *
+ * <simpleType name="enumSide">
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ * <enumeration value="LEFT"/>
+ * <enumeration value="RIGHT"/>
+ * </restriction>
+ * </simpleType>
+ *
+ *
+ */
+@XmlEnum
+public enum EnumSide {
+
+ LEFT, RIGHT;
+
+ public String value() {
+ return name();
+ }
+
+ public static EnumSide fromValue(String v) {
+ return valueOf(v);
+ }
+
+}
diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/EnumTypes.java b/src/main/java/org/jrimum/texgit/language/EnumTypes.java
similarity index 51%
rename from src/br/com/nordestefomento/jrimum/texgit/language/EnumTypes.java
rename to src/main/java/org/jrimum/texgit/language/EnumTypes.java
index 7582f91..ddd4cad 100644
--- a/src/br/com/nordestefomento/jrimum/texgit/language/EnumTypes.java
+++ b/src/main/java/org/jrimum/texgit/language/EnumTypes.java
@@ -1,3 +1,31 @@
+/*
+ * Copyright 2008 JRimum Project
+ *
+ * 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.
+ *
+ * Created at: 03/08/2008 - 12:27:56
+ *
+ * ================================================================================
+ *
+ * Direitos autorais 2008 JRimum Project
+ *
+ * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar
+ * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma
+ * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que
+ * haja exigência legal ou acordo por escrito, a distribuição de software sob
+ * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER
+ * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a
+ * reger permissões e limitações sob esta LICENÇA.
+ *
+ * Criado em: 03/08/2008 - 12:27:56
+ *
+ */
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
// See http://java.sun.com/xml/jaxb
@@ -5,7 +33,7 @@
// Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00
//
-package br.com.nordestefomento.jrimum.texgit.language;
+package org.jrimum.texgit.language;
import javax.xml.bind.annotation.XmlEnum;
diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/MetaField.java b/src/main/java/org/jrimum/texgit/language/MetaField.java
similarity index 68%
rename from src/br/com/nordestefomento/jrimum/texgit/language/MetaField.java
rename to src/main/java/org/jrimum/texgit/language/MetaField.java
index e43342a..2ac6d74 100644
--- a/src/br/com/nordestefomento/jrimum/texgit/language/MetaField.java
+++ b/src/main/java/org/jrimum/texgit/language/MetaField.java
@@ -1,3 +1,31 @@
+/*
+ * Copyright 2008 JRimum Project
+ *
+ * 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.
+ *
+ * Created at: 03/08/2008 - 12:27:56
+ *
+ * ================================================================================
+ *
+ * Direitos autorais 2008 JRimum Project
+ *
+ * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar
+ * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma
+ * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que
+ * haja exigência legal ou acordo por escrito, a distribuição de software sob
+ * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER
+ * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a
+ * reger permissões e limitações sob esta LICENÇA.
+ *
+ * Criado em: 03/08/2008 - 12:27:56
+ *
+ */
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
// See http://java.sun.com/xml/jaxb
@@ -5,7 +33,7 @@
// Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00
//
-package br.com.nordestefomento.jrimum.texgit.language;
+package org.jrimum.texgit.language;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@@ -39,6 +67,8 @@ public class MetaField {
@XmlAttribute
protected Boolean blankAccepted;
@XmlAttribute
+ protected Boolean truncate;
+ @XmlAttribute
protected EnumFormats format;
@XmlAttribute(required = true)
protected int length;
@@ -117,6 +147,31 @@ public boolean isBlankAccepted() {
public void setBlankAccepted(Boolean value) {
this.blankAccepted = value;
}
+
+ /**
+ * Gets the value of the truncate property.
+ *
+ * @return possible object is {@link Boolean }
+ *
+ */
+ public boolean isTruncate() {
+ if (truncate == null) {
+ return false;
+ } else {
+ return truncate;
+ }
+ }
+
+ /**
+ * Sets the value of the blankAccepted property.
+ *
+ * @param value
+ * allowed object is {@link Boolean }
+ *
+ */
+ public void setTruncate(Boolean value) {
+ this.truncate = value;
+ }
/**
* Gets the value of the format property.
diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/MetaFiller.java b/src/main/java/org/jrimum/texgit/language/MetaFiller.java
similarity index 52%
rename from src/br/com/nordestefomento/jrimum/texgit/language/MetaFiller.java
rename to src/main/java/org/jrimum/texgit/language/MetaFiller.java
index 17809c2..d911be7 100644
--- a/src/br/com/nordestefomento/jrimum/texgit/language/MetaFiller.java
+++ b/src/main/java/org/jrimum/texgit/language/MetaFiller.java
@@ -1,3 +1,31 @@
+/*
+ * Copyright 2008 JRimum Project
+ *
+ * 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.
+ *
+ * Created at: 03/08/2008 - 12:27:56
+ *
+ * ================================================================================
+ *
+ * Direitos autorais 2008 JRimum Project
+ *
+ * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar
+ * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma
+ * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que
+ * haja exigência legal ou acordo por escrito, a distribuição de software sob
+ * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER
+ * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a
+ * reger permissões e limitações sob esta LICENÇA.
+ *
+ * Criado em: 03/08/2008 - 12:27:56
+ *
+ */
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
// See http://java.sun.com/xml/jaxb
@@ -5,13 +33,15 @@
// Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00
//
-package br.com.nordestefomento.jrimum.texgit.language;
+package org.jrimum.texgit.language;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
+import org.jrimum.texgit.type.component.Side;
+
/**
*
*
diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/MetaFlatFile.java b/src/main/java/org/jrimum/texgit/language/MetaFlatFile.java
similarity index 55%
rename from src/br/com/nordestefomento/jrimum/texgit/language/MetaFlatFile.java
rename to src/main/java/org/jrimum/texgit/language/MetaFlatFile.java
index a7e2231..f1c2f16 100644
--- a/src/br/com/nordestefomento/jrimum/texgit/language/MetaFlatFile.java
+++ b/src/main/java/org/jrimum/texgit/language/MetaFlatFile.java
@@ -1,3 +1,31 @@
+/*
+ * Copyright 2008 JRimum Project
+ *
+ * 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.
+ *
+ * Created at: 03/08/2008 - 12:27:56
+ *
+ * ================================================================================
+ *
+ * Direitos autorais 2008 JRimum Project
+ *
+ * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar
+ * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma
+ * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que
+ * haja exigência legal ou acordo por escrito, a distribuição de software sob
+ * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER
+ * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a
+ * reger permissões e limitações sob esta LICENÇA.
+ *
+ * Criado em: 03/08/2008 - 12:27:56
+ *
+ */
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
// See http://java.sun.com/xml/jaxb
@@ -5,7 +33,7 @@
// Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00
//
-package br.com.nordestefomento.jrimum.texgit.language;
+package org.jrimum.texgit.language;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/MetaFormatter.java b/src/main/java/org/jrimum/texgit/language/MetaFormatter.java
similarity index 51%
rename from src/br/com/nordestefomento/jrimum/texgit/language/MetaFormatter.java
rename to src/main/java/org/jrimum/texgit/language/MetaFormatter.java
index 4e579ad..e712fca 100644
--- a/src/br/com/nordestefomento/jrimum/texgit/language/MetaFormatter.java
+++ b/src/main/java/org/jrimum/texgit/language/MetaFormatter.java
@@ -1,3 +1,31 @@
+/*
+ * Copyright 2008 JRimum Project
+ *
+ * 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.
+ *
+ * Created at: 03/08/2008 - 12:27:56
+ *
+ * ================================================================================
+ *
+ * Direitos autorais 2008 JRimum Project
+ *
+ * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar
+ * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma
+ * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que
+ * haja exigência legal ou acordo por escrito, a distribuição de software sob
+ * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER
+ * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a
+ * reger permissões e limitações sob esta LICENÇA.
+ *
+ * Criado em: 03/08/2008 - 12:27:56
+ *
+ */
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
// See http://java.sun.com/xml/jaxb
@@ -5,7 +33,7 @@
// Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00
//
-package br.com.nordestefomento.jrimum.texgit.language;
+package org.jrimum.texgit.language;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/MetaGroupFields.java b/src/main/java/org/jrimum/texgit/language/MetaGroupFields.java
similarity index 61%
rename from src/br/com/nordestefomento/jrimum/texgit/language/MetaGroupFields.java
rename to src/main/java/org/jrimum/texgit/language/MetaGroupFields.java
index 6e8d489..e43ae9f 100644
--- a/src/br/com/nordestefomento/jrimum/texgit/language/MetaGroupFields.java
+++ b/src/main/java/org/jrimum/texgit/language/MetaGroupFields.java
@@ -1,3 +1,31 @@
+/*
+ * Copyright 2008 JRimum Project
+ *
+ * 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.
+ *
+ * Created at: 03/08/2008 - 12:27:56
+ *
+ * ================================================================================
+ *
+ * Direitos autorais 2008 JRimum Project
+ *
+ * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar
+ * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma
+ * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que
+ * haja exigência legal ou acordo por escrito, a distribuição de software sob
+ * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER
+ * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a
+ * reger permissões e limitações sob esta LICENÇA.
+ *
+ * Criado em: 03/08/2008 - 12:27:56
+ *
+ */
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6
// See http://java.sun.com/xml/jaxb
@@ -5,10 +33,11 @@
// Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00
//
-package br.com.nordestefomento.jrimum.texgit.language;
+package org.jrimum.texgit.language;
import java.util.ArrayList;
import java.util.List;
+
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@@ -23,10 +52,6 @@
* Agregado de fields.
*
+ * Para defini��o da posi��o. + *
+ * + * + * + * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MetaOrderedField") +public class MetaOrderedField extends MetaField { + + @XmlAttribute(required = true) + protected int position; + + /** + * Gets the value of the position property. + * + */ + public int getPosition() { + return position; + } + + /** + * Sets the value of the position property. + * + */ + public void setPosition(int value) { + this.position = value; + } + +} diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/MetaRecord.java b/src/main/java/org/jrimum/texgit/language/MetaRecord.java similarity index 67% rename from src/br/com/nordestefomento/jrimum/texgit/language/MetaRecord.java rename to src/main/java/org/jrimum/texgit/language/MetaRecord.java index 6efc7cc..fbd3568 100644 --- a/src/br/com/nordestefomento/jrimum/texgit/language/MetaRecord.java +++ b/src/main/java/org/jrimum/texgit/language/MetaRecord.java @@ -1,3 +1,32 @@ +/* + * Copyright 2008 JRimum Project + * + * 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. + * + * Created at: 03/08/2008 - 12:27:56 + * + * ================================================================================ + * + * Direitos autorais 2008 JRimum Project + * + * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar + * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma + * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que + * haja exigência legal ou acordo por escrito, a distribuição de software sob + * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER + * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a + * reger permissões e limitações sob esta LICENÇA. + * + * Criado em: 03/08/2008 - 12:27:56 + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 // See http://java.sun.com/xml/jaxb @@ -5,7 +34,7 @@ // Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00 // -package br.com.nordestefomento.jrimum.texgit.language; +package org.jrimum.texgit.language; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/MetaTexgit.java b/src/main/java/org/jrimum/texgit/language/MetaTexgit.java similarity index 54% rename from src/br/com/nordestefomento/jrimum/texgit/language/MetaTexgit.java rename to src/main/java/org/jrimum/texgit/language/MetaTexgit.java index 1bb9318..8ae0fb5 100644 --- a/src/br/com/nordestefomento/jrimum/texgit/language/MetaTexgit.java +++ b/src/main/java/org/jrimum/texgit/language/MetaTexgit.java @@ -1,3 +1,32 @@ +/* + * Copyright 2008 JRimum Project + * + * 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. + * + * Created at: 03/08/2008 - 12:27:56 + * + * ================================================================================ + * + * Direitos autorais 2008 JRimum Project + * + * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar + * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma + * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que + * haja exigência legal ou acordo por escrito, a distribuição de software sob + * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER + * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a + * reger permissões e limitações sob esta LICENÇA. + * + * Criado em: 03/08/2008 - 12:27:56 + * + */ + // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 // See http://java.sun.com/xml/jaxb @@ -5,7 +34,7 @@ // Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00 // -package br.com.nordestefomento.jrimum.texgit.language; +package org.jrimum.texgit.language; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; diff --git a/src/br/com/nordestefomento/jrimum/texgit/language/ObjectFactory.java b/src/main/java/org/jrimum/texgit/language/ObjectFactory.java similarity index 65% rename from src/br/com/nordestefomento/jrimum/texgit/language/ObjectFactory.java rename to src/main/java/org/jrimum/texgit/language/ObjectFactory.java index 71f7d09..b7a513b 100644 --- a/src/br/com/nordestefomento/jrimum/texgit/language/ObjectFactory.java +++ b/src/main/java/org/jrimum/texgit/language/ObjectFactory.java @@ -1,3 +1,31 @@ +/* + * Copyright 2008 JRimum Project + * + * 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. + * + * Created at: 03/08/2008 - 12:27:56 + * + * ================================================================================ + * + * Direitos autorais 2008 JRimum Project + * + * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar + * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma + * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que + * haja exigência legal ou acordo por escrito, a distribuição de software sob + * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER + * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a + * reger permissões e limitações sob esta LICENÇA. + * + * Criado em: 03/08/2008 - 12:27:56 + * + */ // // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.0 in JDK 1.6 // See http://java.sun.com/xml/jaxb @@ -5,7 +33,7 @@ // Generated on: 2008.08.03 at 12:27:56 AM GMT-03:00 // -package br.com.nordestefomento.jrimum.texgit.language; +package org.jrimum.texgit.language; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlElementDecl; @@ -26,8 +54,8 @@ @XmlRegistry public class ObjectFactory { - private final static QName _Texgit_QNAME = new QName( - "http://gilmatryx.googlepages.com/Texgit", "Texgit"); + private final static QName TEXGIT_QNAME = new QName( + "http://jrimum.org/texgit", "Texgit"); /** * Create a new ObjectFactory that can be used to create new instances of @@ -121,9 +149,9 @@ public MetaFiller createMetaFiller() { * Create an instance of {@link JAXBElement }{@code <}{@link MetaTexgit }{@code >}} * */ - @XmlElementDecl(namespace = "http://gilmatryx.googlepages.com/Texgit", name = "Texgit") + @XmlElementDecl(namespace = "http://jrimum.org/texgit", name = "Texgit") public JAXBElement
+ * Exemplo:
+ *
+ * Se sideToFill == SideToFill.LEFT, o caracter especificado será adicionado à String
+ * no lado esquerdo até que o campo fique com o tamanho que foi definido.
+ *
fill(String, int) passando o parâmetro
+ * toFill como String.valueOf(toFill).
+ *
+ * @param tofill
+ * @param length
+ * @return String preenchida
+ *
+ * @see Filler#fill(String, int)
+ *
+ * @since 0.2
+ */
+ String fill(long tofill, int length);
+
+ /**
+ * Executa o método fill(String, int) passando o parâmetro
+ * toFill como String.valueOf(toFill).
+ *
+ * @param tofill
+ * @param length
+ * @return String preenchida
+ *
+ * @see Filler#fill(String, int)
+ *
+ * @since 0.2
+ */
+ String fill(int tofill, int length);
+
+ /**
+ * Executa o método fill(String, int) passando o parâmetro
+ * toFill como String.valueOf(toFill).
+ *
+ * @param tofill
+ * @param length
+ * @return String preenchida
+ *
+ * @see Filler#fill(String, int)
+ *
+ * @since 0.2
+ */
+ String fill(short tofill, int length);
+
+ /**
+ * Executa o método fill(String, int) passando o parâmetro
+ * toFill como String.valueOf(toFill).
+ *
+ * @param tofill
+ * @param length
+ * @return String preenchida
+ *
+ * @see Filler#fill(String, int)
+ *
+ * @since 0.2
+ */
+ String fill(byte tofill, int length);
+
+ /**
+ * Executa o método fill(String, int) passando o parâmetro
+ * toFill como String.valueOf(toFill).
+ *
+ * @param tofill
+ * @param length
+ * @return String preenchida
+ *
+ * @see Filler#fill(String, int)
+ *
+ * @since 0.2
+ */
+ String fill(char tofill, int length);
+
+ /**
+ * Executa o método fill(String, int) passando o parâmetro
+ * toFill como String.valueOf(toFill).
+ *
+ * @param tofill
+ * @param length
+ * @return String preenchida
+ *
+ * @see Filler#fill(String, int)
+ *
+ * @since 0.2
+ */
+ String fill(double tofill, int length);
+
+ /**
+ * Executa o método fill(String, int) passando o parâmetro
+ * toFill como String.valueOf(toFill).
+ *
+ * @param tofill
+ * @param length
+ * @return String preenchida
+ *
+ * @see Filler#fill(String, int)
+ *
+ * @since
+ */
+ String fill(float tofill, int length);
+
+ /**
+ * Executa o método fill(String, int) passando o parâmetro
+ * toFill como toFill.toString().
+ *
+ *
+ * Caso toFill seja null, o método
+ * fill(String, int) receberá uma String nula como parâmetro.
+ *
fill(String, int) passando o parâmetro
+ * toFill como toFill.write().
+ *
+ *
+ * Caso toFill seja null, o método
+ * fill(String, int) receberá uma String nula como parâmetro.
+ *
+ * {
+ * isLenghtAsDefine();
+ * isSizeAsDefine();
+ * }
+ *
+ *
+ * @return Indicativo se está de acordo com o definido
+ *
+ * @throws IllegalStateException
+ */
+ public abstract boolean isFixedAsDefined() throws IllegalStateException;
+}
diff --git a/src/main/java/org/jrimum/texgit/type/FixedField.java b/src/main/java/org/jrimum/texgit/type/FixedField.java
new file mode 100644
index 0000000..e1073cc
--- /dev/null
+++ b/src/main/java/org/jrimum/texgit/type/FixedField.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2008 JRimum Project
+ *
+ * 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.
+ *
+ * Created at: 26/07/2008 - 12:44:41
+ *
+ * ================================================================================
+ *
+ * Direitos autorais 2008 JRimum Project
+ *
+ * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar
+ * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma
+ * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que
+ * haja exigência legal ou acordo por escrito, a distribuição de software sob
+ * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER
+ * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a
+ * reger permissões e limitações sob esta LICENÇA.
+ *
+ * Criado em: 26/07/2008 - 12:44:41
+ *
+ */
+package org.jrimum.texgit.type;
+
+
+/**
+ * @author Gilmar P.S.L.
+ *
+ * @param + * Tamanho da string de escrita do bloco. + *
+ */ + private Integer instantLength; + + /** + *+ * Ao ultrapassar o tamanho, define se pode truncar ou se dispara uma exceção. + *
+ */ + private boolean truncate; + + /** + * + */ + public BlockOfFields() { + super(); + } + + /** + * @param length + * @param size + */ + public BlockOfFields(Integer length, Integer size) { + + super(size); + + Objects.checkNotNull(length, "length"); + + if (length > 0) { + + setLength(length); + setSize(size); + + } else + throw new IllegalArgumentException(format("O comprimento do bloco [%s] deve ser um número natural > 0!", length)); + } + + @Override + public BlockOfFields clone() throws CloneNotSupportedException { + + return(BlockOfFields) super.clone(); + } + + @Override + public void read(String lineOfFields) { + + Objects.checkNotNull(lineOfFields, "String de leitura nula!"); + + Objects.checkNotNull(getFields(), "Fields == null"); + Collections.checkNotEmpty(getFields(), "Coleção de fields vazia!"); + + if (isSizeAsDefinaed() && isLengthWithDefinaed(lineOfFields.length())) { + + StringBuilder builder = new StringBuilder(lineOfFields); + + for (FixedField> field : getFields()) { + + try { + + field.read(builder.substring(0, field.getFixedLength())); + builder.delete(0, field.getFixedLength()); + + } catch (Exception e) { + + throw new IllegalStateException( + format( + "Erro ao tentar ler o campo \"%s\" na posição [%s] no layout do registro.", + field.getName(), getFields().indexOf(field)+1),e); + } + } + + builder = null; + } + } + + @Override + public String write() { + + Objects.checkNotNull(getFields(), "Fields == null"); + Collections.checkNotEmpty(getFields(), "Coleção de fields vazia!"); + + String str = null; + + isSizeAsDefinaed(); + + str = super.write(); + + instantLength = str.length(); + + if (isTruncate() && instantLength > getFixedLength()) { + str = str.substring(0, getFixedLength()); + instantLength = getFixedLength(); + } + + isFixedAsDefined(); + + return str; + } + + public boolean isFixedAsDefined() throws IllegalStateException { + + return (isSizeAsDefinaed() && isLengthWithDefinaed()); + } + + private boolean isLengthWithDefinaed(){ + + return isLengthWithDefinaed(instantLength); + } + + private boolean isLengthWithDefinaed(int length){ + + if(length == getFixedLength()) + return true; + else + throw new IllegalStateException(format("O comprimento da string [%s] é incompátivel com o definido [%s] no layout do registro!",length,getFixedLength())); + } + + private boolean isSizeAsDefinaed(){ + + if(size() == getFixedSize()) + return true; + else + throw new IllegalStateException(format("O número de fields [%s] é incompátivel com o definido [%s]!", size(), getFixedSize())); + } + + /** + * @return the length + */ + public Integer getFixedLength() { + return length; + } + + /** + * @param length the length to set + */ + protected void setLength(Integer length) { + + if (isNotNull(length)) + this.length = length; + else + throw new IllegalArgumentException(format("Comprimento inválido [%s]!", length)); + } + + /** + * @return the size + */ + public Integer getFixedSize() { + return size; + } + + /** + * @param size the size to set + */ + protected void setSize(Integer size) { + + if (isNotNull(size)) + this.size = size; + else + throw new IllegalArgumentException(format("Tamanho inválido [%s]!", size)); + } + + public boolean isTruncate() { + return this.truncate; + } + + public void setTruncate(boolean truncate) { + this.truncate = truncate; + } +} diff --git a/src/main/java/org/jrimum/texgit/type/component/Field.java b/src/main/java/org/jrimum/texgit/type/component/Field.java new file mode 100644 index 0000000..bae9ab5 --- /dev/null +++ b/src/main/java/org/jrimum/texgit/type/component/Field.java @@ -0,0 +1,406 @@ +/* + * Copyright 2008 JRimum Project + * + * 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. + * + * Created at: 26/07/2008 - 12:44:41 + * + * ================================================================================ + * + * Direitos autorais 2008 JRimum Project + * + * Licenciado sob a Licença Apache, Versão 2.0 ("LICENÇA"); você não pode usar + * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma + * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que + * haja exigência legal ou acordo por escrito, a distribuição de software sob + * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER + * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a + * reger permissões e limitações sob esta LICENÇA. + * + * Criado em: 26/07/2008 - 12:44:41 + * + */ +package org.jrimum.texgit.type.component; + +import static java.lang.String.format; +import static org.apache.commons.lang.StringUtils.EMPTY; +import static org.apache.commons.lang.StringUtils.isBlank; +import static org.apache.commons.lang.StringUtils.isNumeric; +import static org.jrimum.utilix.Objects.isNotNull; + +import java.lang.reflect.Constructor; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.Format; +import java.text.ParseException; +import java.util.Date; + +import org.jrimum.texgit.TextStream; +import org.jrimum.utilix.Dates; +import org.jrimum.utilix.Objects; + +/** + * @author Gilmar P.S.L. + * + * @param+ *Nome do campo, também pode ser usado como id. + *
+ */ + private String name; + + /** + *+ * Valor do campo. + *
+ */ + private G value; + + /** + *+ * Formatador utilizado na leitura e escrita do valor do campo. + *
+ */ + private Format formatter; + + /** + *+ * Necessário para ler campos númericos em branco. + *
+ */ + private boolean blankAccepted; + + /** + * + */ + public Field() { + super(); + } + + /** + * @param value + */ + public Field(G value) { + super(); + setValue(value); + } + + /** + *
+ * Cria um Field com um valor e um formatador para o valor. Isto significa que a leitura e escrita do valor informado
+ * será de acordo com o formatador.
+ *
+ * Cria um Field com nome para identificação, valor e um formatador.
+ *
@@ -58,8 +56,8 @@ * *
* @author Gilmar P.S.L - * @author Misael Barreto - * @author Rômulo Augusto + * @author Misael Barreto + * @author Rômulo Augusto * @author Nordeste Fomento * Mercantil * @@ -68,10 +66,9 @@ * @version 0.2.1-inc * */ - @SuppressWarnings("serial") -public class Filler- * Preenche o campo com o caracter especificado e no lado especificado. - *
- *
- * Exemplo:
- *
- * Se sideToFill == SideToFill.LEFT, o caracter especificado será adicionado à String
- * no lado esquerdo até que o campo fique com o tamanho que foi definido.
- *
- * Executa o método fill(String, int) passando o parâmetro
- * toFill como String.valueOf(toFill).
- *
- * Executa o método fill(String, int) passando o parâmetro
- * toFill como String.valueOf(toFill).
- *
- * Executa o método fill(String, int) passando o parâmetro
- * toFill como String.valueOf(toFill).
- *
- * Executa o método fill(String, int) passando o parâmetro
- * toFill como String.valueOf(toFill).
- *
- * Executa o método fill(String, int) passando o parâmetro
- * toFill como String.valueOf(toFill).
- *
- * Executa o método fill(String, int) passando o parâmetro
- * toFill como String.valueOf(toFill).
- *
- * Executa o método fill(String, int) passando o parâmetro
- * toFill como String.valueOf(toFill).
- *
- * Executa o método fill(String, int) passando o parâmetro
- * toFill como toFill.toString().
- *
- *
- * Caso toFill seja null, o método
- * fill(String, int) receberá uma String nula como parâmetro.
- *
- * Executa o método fill(String, int) passando o parâmetro
- * toFill como toFill.write().
- *
- *
- * Caso toFill seja null, o método
- * fill(String, int) receberá uma String nula como parâmetro.
- *
+ * Tamanho de especificação e parâmetro da string de leitura ou escrita do campo. + *
+ */ + private Integer length; + + /** + *+ * Preenchedor do valor utilizado na hora da escrita. + *
+ */ + private Filler filler; + + + /** + *+ * Tamanho da string de escrita do campo. + *
+ */ + private Integer instantLength; + + /** + *+ * Ao ultrapassar o tamanho, define se pode truncar ou se dispara uma exceção. + *
+ */ + private boolean truncate; + + + /** + * + */ + public FixedField() { + super(); + } + + public FixedField(G value, Integer length) { + super(value); + setFixedLength(length); + } + + public FixedField(G value, Integer length, Filler filler) { + super(value); + setFixedLength(length); + setFiller(filler); + } + + public FixedField(G value, Integer length, Format formatter) { + super(value,formatter); + setFixedLength(length); + } + + public FixedField(G value, Integer length, Format formatter, Filler filler) { + super(value,formatter); + setFixedLength(length); + setFiller(filler); + } + + public FixedField(String name, G value, Integer length) { + super(name,value); + setFixedLength(length); + } + + public FixedField(String name, G value, Integer length, Filler filler) { + super(name,value); + setFixedLength(length); + setFiller(filler); + } + + public FixedField(String name, G value, Integer length, Format formatter) { + super(name,value,formatter); + setFixedLength(length); + } + + public FixedField(String name, G value, Integer length, Format formatter, Filler filler) { + super(name,value,formatter); + setFixedLength(length); + setFiller(filler); + } + + @Override + public FixedField
+ * Teste unitário para a classe Filler.
+ *
+ * Teste unitário para a classe utilitária de coleções. + *
+ * + * @author Gilmar P.S.L. + * @author Rômulo Augusto + * + * @since 0.2 + * + * @version 0.2 + */ +public class TestFixedField { + + private static final DateFormat FORMAT_DDMMYY = new SimpleDateFormat("ddMMyy"); + + private FixedField
+ * Classe para uso em testes com Fields.
+ *