Search in sources :

Example 16 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Boolean

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Boolean in project jaxdb by jaxdb.

the class Generator method getTypes.

private Type[] getTypes(final Table table, final Map<String, Table> tableNameToTable, final int depth, final Info info) throws GeneratorExecutionException {
    final List<$Column> columns = table.getColumn();
    final int size = columns == null ? 0 : columns.size();
    final Type[] types;
    if (table.getExtends$() == null) {
        types = new Type[depth + size];
        info.rootClassName = schemaClassName + "." + Identifiers.toClassCase(table.getName$().text());
    } else {
        types = getTypes(tableNameToTable.get(table.getExtends$().text()), tableNameToTable, depth + size, info);
    }
    if (columns != null) {
        final boolean isSuperTable = depth != 0;
        info.totalPrimaryCount.inc(getPrimaryColumnCount(table), isSuperTable);
        for (int c = 1; c <= size; ++c) {
            final $Column column = columns.get(size - c);
            final Type type = getType(table, column);
            if (org.jaxdb.ddlx.Generator.isAuto(column))
                info.totalAutoCount.inc(1, isSuperTable);
            if (type.keyForUpdate)
                info.totalKeyForUpdateCount.inc(1, isSuperTable);
            types[types.length - depth - c] = type;
        }
    }
    return types;
}
Also used : org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Column(org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Column) org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Tinyint(org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Tinyint) org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Bigint(org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Bigint) org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Smallint(org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Smallint)

Example 17 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Boolean

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Boolean in project jss by dogtagpki.

the class IssuingDistributionPoint method encode.

@Override
public void encode(Tag implicitTag, OutputStream ostream) throws IOException {
    SEQUENCE seq = new SEQUENCE();
    DerOutputStream derOut;
    try {
        // is a CHOICE, the [0] tag is forced to be EXPLICIT.
        if (fullName != null) {
            EXPLICIT distPoint = new EXPLICIT(Tag.get(0), fullNameEncoding);
            seq.addElement(distPoint);
        } else if (relativeName != null) {
            derOut = new DerOutputStream();
            relativeName.encode(derOut);
            ANY raw = new ANY(derOut.toByteArray());
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            raw.encodeWithAlternateTag(Tag.get(1), bos);
            ANY distPointName = new ANY(bos.toByteArray());
            EXPLICIT distPoint = new EXPLICIT(Tag.get(0), distPointName);
            seq.addElement(distPoint);
        }
        if (onlyContainsUserCerts != false) {
            seq.addElement(Tag.get(1), new BOOLEAN(true));
        }
        if (onlyContainsCACerts != false) {
            seq.addElement(Tag.get(2), new BOOLEAN(true));
        }
        // Encodes the ReasonFlags.
        if (onlySomeReasons != null) {
            derOut = new DerOutputStream();
            derOut.putUnalignedBitString(onlySomeReasons);
            ANY raw = new ANY(derOut.toByteArray());
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            raw.encodeWithAlternateTag(Tag.get(3), bos);
            ANY reasonEncoding = new ANY(bos.toByteArray());
            seq.addElement(reasonEncoding);
        }
        if (indirectCRL != false) {
            seq.addElement(Tag.get(4), new BOOLEAN(true));
        }
        seq.encode(implicitTag, ostream);
    } catch (InvalidBERException e) {
        // the Sun encoding classes
        throw new IOException(e.toString());
    }
}
Also used : InvalidBERException(org.mozilla.jss.asn1.InvalidBERException) DerOutputStream(org.mozilla.jss.netscape.security.util.DerOutputStream) SEQUENCE(org.mozilla.jss.asn1.SEQUENCE) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) ANY(org.mozilla.jss.asn1.ANY) EXPLICIT(org.mozilla.jss.asn1.EXPLICIT) BOOLEAN(org.mozilla.jss.asn1.BOOLEAN)

Example 18 with org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Boolean

use of org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Boolean in project jss by dogtagpki.

the class PKIArchiveOptions method encode.

/**
 * DER-encodes a PKIArchiveOptions.
 * @param implicitTag <b>This parameter is ignored.</b> A CHOICE cannot
 *      have an implicit tag.
 */
@Override
public void encode(Tag implicitTag, OutputStream ostream) throws IOException {
    // no implicit tags on a CHOICE
    assert (implicitTag.equals(tag));
    if (type == ENCRYPTED_PRIV_KEY) {
        // CHOICEs are always EXPLICITly tagged
        EXPLICIT explicit = new EXPLICIT(new Tag(0), encryptedPrivKey);
        explicit.encode(tag, ostream);
    } else if (type == KEY_GEN_PARAMETERS) {
        keyGenParameters.encode(tag, ostream);
    } else {
        assert (type == ARCHIVE_REM_GEN_PRIV_KEY);
        (new BOOLEAN(archiveRemGenPrivKey)).encode(tag, ostream);
    }
}
Also used : Tag(org.mozilla.jss.asn1.Tag) EXPLICIT(org.mozilla.jss.asn1.EXPLICIT) BOOLEAN(org.mozilla.jss.asn1.BOOLEAN)

Aggregations

org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Bigint (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Bigint)9 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Smallint (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Smallint)9 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Column (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Column)8 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Tinyint (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Tinyint)8 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Boolean (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Boolean)7 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Decimal (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Decimal)7 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Binary (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Binary)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Blob (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Blob)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Char (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Char)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Clob (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Clob)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Date (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Date)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Datetime (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Datetime)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Double (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Double)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Float (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Float)6 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Time (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Time)6 BOOLEAN (org.mozilla.jss.asn1.BOOLEAN)5 org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Int (org.jaxdb.www.ddlx_0_5.xLygluGCXAA.$Int)4 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 List (java.util.List)3