├── .github
└── workflows
│ └── java-ci.yml
├── .gitignore
├── LICENSE.txt
├── README.md
├── pom.xml
├── settings.xml
└── src
├── main
└── java
│ ├── com
│ └── siemens
│ │ └── ct
│ │ └── exi
│ │ └── core
│ │ ├── CodingMode.java
│ │ ├── Constants.java
│ │ ├── DecodingOptions.java
│ │ ├── EXIBodyDecoder.java
│ │ ├── EXIBodyEncoder.java
│ │ ├── EXIFactory.java
│ │ ├── EXIStreamDecoder.java
│ │ ├── EXIStreamEncoder.java
│ │ ├── EncodingOptions.java
│ │ ├── FidelityOptions.java
│ │ ├── SchemaIdResolver.java
│ │ ├── SelfContainedHandler.java
│ │ ├── attributes
│ │ ├── AttributeFactory.java
│ │ ├── AttributeList.java
│ │ ├── AttributeListImpl.java
│ │ └── package.html
│ │ ├── coder
│ │ ├── AbstractEXIBodyCoder.java
│ │ ├── AbstractEXIBodyDecoder.java
│ │ ├── AbstractEXIBodyEncoder.java
│ │ ├── AbstractEXIHeader.java
│ │ ├── EXIBodyDecoderInOrder.java
│ │ ├── EXIBodyDecoderInOrderSC.java
│ │ ├── EXIBodyDecoderReordered.java
│ │ ├── EXIBodyEncoderInOrder.java
│ │ ├── EXIBodyEncoderInOrderSC.java
│ │ ├── EXIBodyEncoderReordered.java
│ │ ├── EXIHeaderDecoder.java
│ │ ├── EXIHeaderEncoder.java
│ │ ├── EXIStreamDecoderImpl.java
│ │ ├── EXIStreamEncoderImpl.java
│ │ └── package.html
│ │ ├── container
│ │ ├── DocType.java
│ │ ├── NamespaceDeclaration.java
│ │ ├── PreReadValue.java
│ │ ├── ProcessingInstruction.java
│ │ ├── ValueAndDatatype.java
│ │ └── package.html
│ │ ├── context
│ │ ├── AbstractUriContext.java
│ │ ├── GrammarContext.java
│ │ ├── GrammarUriContext.java
│ │ ├── QNameContext.java
│ │ ├── UriContext.java
│ │ └── package.html
│ │ ├── datatype
│ │ ├── AbstractBinaryDatatype.java
│ │ ├── AbstractDatatype.java
│ │ ├── BinaryBase64Datatype.java
│ │ ├── BinaryHexDatatype.java
│ │ ├── BooleanDatatype.java
│ │ ├── BooleanFacetDatatype.java
│ │ ├── Datatype.java
│ │ ├── DatatypeID.java
│ │ ├── DatetimeDatatype.java
│ │ ├── DecimalDatatype.java
│ │ ├── EnumDatatype.java
│ │ ├── EnumerationDatatype.java
│ │ ├── ExtendedStringDatatype.java
│ │ ├── FloatDatatype.java
│ │ ├── IntegerDatatype.java
│ │ ├── ListDatatype.java
│ │ ├── NBitUnsignedIntegerDatatype.java
│ │ ├── RestrictedCharacterSetDatatype.java
│ │ ├── StringDatatype.java
│ │ ├── UnsignedIntegerDatatype.java
│ │ ├── WhiteSpace.java
│ │ ├── charset
│ │ │ ├── AbstractRestrictedCharacterSet.java
│ │ │ ├── CodePointCharacterSet.java
│ │ │ ├── RestrictedCharacterSet.java
│ │ │ ├── XSDBase64CharacterSet.java
│ │ │ ├── XSDBooleanCharacterSet.java
│ │ │ ├── XSDDateTimeCharacterSet.java
│ │ │ ├── XSDDecimalCharacterSet.java
│ │ │ ├── XSDDoubleCharacterSet.java
│ │ │ ├── XSDHexBinaryCharacterSet.java
│ │ │ ├── XSDIntegerCharacterSet.java
│ │ │ ├── XSDStringCharacterSet.java
│ │ │ └── package.html
│ │ ├── package.html
│ │ └── strings
│ │ │ ├── AbstractStringCoder.java
│ │ │ ├── BoundedStringDecoderImpl.java
│ │ │ ├── BoundedStringEncoderImpl.java
│ │ │ ├── StringCoder.java
│ │ │ ├── StringDecoder.java
│ │ │ ├── StringDecoderImpl.java
│ │ │ ├── StringEncoder.java
│ │ │ ├── StringEncoderImpl.java
│ │ │ └── package.html
│ │ ├── exceptions
│ │ ├── EXIException.java
│ │ ├── ErrorHandler.java
│ │ ├── UnsupportedOption.java
│ │ ├── XMLParsingException.java
│ │ └── package.html
│ │ ├── grammars
│ │ ├── AbstractGrammars.java
│ │ ├── Grammars.java
│ │ ├── SchemaInformedGrammars.java
│ │ ├── SchemaLessGrammars.java
│ │ ├── event
│ │ │ ├── AbstractDatatypeEvent.java
│ │ │ ├── AbstractEvent.java
│ │ │ ├── Attribute.java
│ │ │ ├── AttributeGeneric.java
│ │ │ ├── AttributeNS.java
│ │ │ ├── Characters.java
│ │ │ ├── CharactersGeneric.java
│ │ │ ├── Comment.java
│ │ │ ├── DatatypeEvent.java
│ │ │ ├── DocType.java
│ │ │ ├── EndDocument.java
│ │ │ ├── EndElement.java
│ │ │ ├── EntityReference.java
│ │ │ ├── Event.java
│ │ │ ├── EventType.java
│ │ │ ├── NamespaceDeclaration.java
│ │ │ ├── ProcessingInstruction.java
│ │ │ ├── SelfContained.java
│ │ │ ├── StartDocument.java
│ │ │ ├── StartElement.java
│ │ │ ├── StartElementGeneric.java
│ │ │ ├── StartElementNS.java
│ │ │ └── package.html
│ │ ├── grammar
│ │ │ ├── AbstractBuiltInContent.java
│ │ │ ├── AbstractBuiltInGrammar.java
│ │ │ ├── AbstractGrammar.java
│ │ │ ├── AbstractSchemaInformedContent.java
│ │ │ ├── AbstractSchemaInformedGrammar.java
│ │ │ ├── BuiltInDocContent.java
│ │ │ ├── BuiltInElement.java
│ │ │ ├── BuiltInFragmentContent.java
│ │ │ ├── BuiltInGrammar.java
│ │ │ ├── BuiltInStartTag.java
│ │ │ ├── DocEnd.java
│ │ │ ├── Document.java
│ │ │ ├── Fragment.java
│ │ │ ├── Grammar.java
│ │ │ ├── GrammarType.java
│ │ │ ├── SchemaInformedDocContent.java
│ │ │ ├── SchemaInformedElement.java
│ │ │ ├── SchemaInformedFirstStartTag.java
│ │ │ ├── SchemaInformedFirstStartTagGrammar.java
│ │ │ ├── SchemaInformedFragmentContent.java
│ │ │ ├── SchemaInformedGrammar.java
│ │ │ ├── SchemaInformedStartTag.java
│ │ │ ├── SchemaInformedStartTagGrammar.java
│ │ │ └── package.html
│ │ ├── package.html
│ │ └── production
│ │ │ ├── AbstractProduction.java
│ │ │ ├── Production.java
│ │ │ ├── SchemaInformedProduction.java
│ │ │ ├── SchemaLessProduction.java
│ │ │ └── package.html
│ │ ├── helpers
│ │ ├── DefaultEXIFactory.java
│ │ ├── DefaultErrorHandler.java
│ │ └── package.html
│ │ ├── io
│ │ ├── BitInputStream.java
│ │ ├── BitOutputStream.java
│ │ ├── channel
│ │ │ ├── AbstractDecoderChannel.java
│ │ │ ├── AbstractEncoderChannel.java
│ │ │ ├── BitDecoderChannel.java
│ │ │ ├── BitEncoderChannel.java
│ │ │ ├── ByteDecoderChannel.java
│ │ │ ├── ByteEncoderChannel.java
│ │ │ ├── DecoderChannel.java
│ │ │ ├── EncoderChannel.java
│ │ │ └── package.html
│ │ ├── compression
│ │ │ └── EXIInflaterInputStream.java
│ │ └── package.html
│ │ ├── package.html
│ │ ├── types
│ │ ├── AbstractTypeCoder.java
│ │ ├── AbstractTypeDecoder.java
│ │ ├── AbstractTypeEncoder.java
│ │ ├── BuiltIn.java
│ │ ├── BuiltInType.java
│ │ ├── DateTimeType.java
│ │ ├── IntegerType.java
│ │ ├── LexicalTypeDecoder.java
│ │ ├── LexicalTypeEncoder.java
│ │ ├── StringTypeDecoder.java
│ │ ├── StringTypeEncoder.java
│ │ ├── TypeCoder.java
│ │ ├── TypeDecoder.java
│ │ ├── TypeEncoder.java
│ │ ├── TypedTypeDecoder.java
│ │ ├── TypedTypeEncoder.java
│ │ └── package.html
│ │ ├── util
│ │ ├── MethodsBag.java
│ │ ├── package.html
│ │ ├── sort
│ │ │ ├── AttributeSort.java
│ │ │ ├── QNameSort.java
│ │ │ ├── StartElementSort.java
│ │ │ └── package.html
│ │ └── xml
│ │ │ ├── QNameUtilities.java
│ │ │ ├── XMLWhitespace.java
│ │ │ └── package.html
│ │ └── values
│ │ ├── AbstractBinaryValue.java
│ │ ├── AbstractValue.java
│ │ ├── BinaryBase64Value.java
│ │ ├── BinaryHexValue.java
│ │ ├── BooleanValue.java
│ │ ├── DateTimeValue.java
│ │ ├── DecimalValue.java
│ │ ├── FloatValue.java
│ │ ├── IntegerValue.java
│ │ ├── IntegerValueType.java
│ │ ├── ListValue.java
│ │ ├── QNameValue.java
│ │ ├── StringValue.java
│ │ ├── Value.java
│ │ ├── ValueType.java
│ │ └── package.html
│ └── overview.html
└── test
└── java
└── com
└── siemens
└── ct
└── exi
└── core
├── attributes
└── AttributeListCoreTest.java
├── coder
├── EXIHeaderCoreTest.java
└── SchemaLessCoreTest.java
├── datatype
├── AbstractCoreTestCase.java
├── BinaryCoreTest.java
├── BooleanCoreTest.java
├── DatetimeCoreTest.java
├── DecimalCoreTest.java
├── FloatCoreTest.java
├── IntegerCoreTest.java
├── ListCoreTest.java
├── NBitUnsignedIntegerCoreTest.java
├── StringCoreTest.java
├── StringTableCoreTest.java
└── UnsignedIntegerCoreTest.java
└── types
└── TypeCoreTest.java
/.github/workflows/java-ci.yml:
--------------------------------------------------------------------------------
1 | name: Java CI
2 |
3 | on: [push]
4 |
5 | jobs:
6 | build:
7 | runs-on: ubuntu-latest
8 |
9 | steps:
10 | - uses: actions/checkout@v2
11 | - name: Set up JDK 8
12 | uses: actions/setup-java@v2
13 | with:
14 | java-version: '8'
15 | distribution: 'adopt'
16 | - name: Build with Maven
17 | run: mvn --batch-mode --update-snapshots verify
18 | # - name: Deploy with Maven
19 | # run: mvn deploy --settings settings.xml -DskipTests=true -B
20 | # env:
21 | # SONATYPE_USERNAME: daniel_peintner
22 | # secure: "V/MtY7NEa1wjYVXrvHpZj9kOxehDaOE+86evKTAZJEBqbmAi6nDU+rCKZ6ODJubsf0n6Y4nW2nC/x+8dSuUSLpQA+BoDozS6Topo60Qg/SCoN/7udnxL56o2EYq7aHLPaLPAEoyrZ1EuSwpg+z5Yb6ngQEzr74EG943LgXh/9iN6RG4jidsXULc7XlBflI0trRH9WnlmqXeiKDQWdER//tXmoFidja8rj+Hps78M5sfyJ93BKEZcFnxO1st+IqRX1qBv8WBhQRtQP/yZKkauRTSk8313JGBn/EUegdHDnRZXwbCAuUQ5qBInyGOAGaGC/0iJLIFWDr/BAQG/1Fo4ESf5VysbR7uR4ZpmNyID1erE/ebo8WK61klZFxiFa02Vj3L/pqWbfaplXVhHes2pC9yS/10J3hpgoNiq9hUfO1FVHB9EBVWVimMKqOVZbIAg/UED70YTZKxCRe2szvMVQXtPu7W7EnKIeEbVB5qZiYEp6Tw3/cl8EpTF0fYQR6jh58UuXaxjvGLzCmwGG4odkHcZOisQCREZolQnKROr0hq26QLZMW4gqXfCISPCwmMxxqGAN9OTAVclsIQpwEvH0rGCmpWnXiUhD5xE8SDdw7SZ7wJAhHA1zABO2ZHpIUCN/TRKLynjXkec5E4njs+BTD1kOyu7azGaf4QJEDO1za0="
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .idea
3 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2007-2018 Siemens AG
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # EXIficient
2 |
3 | EXIficient core part of the open source implementation of the W3C [Efficient XML Interchange](http://www.w3.org/TR/exi/) (EXI) format specification.
4 |
5 | [](https://github.com/EXIficient/exificient-core/actions/workflows/java-ci.yml)
6 |
--------------------------------------------------------------------------------
/settings.xml:
--------------------------------------------------------------------------------
1 |
37 | * Note: In case of multiple EXI documents with EXI Compression mode in one 38 | * stream or subsequent data in the stream/file one needs to provide the input 39 | * stream as PushbackInputStream with the size of at least 40 | * 41 | * DecodingOptions.PUSHBACK_BUFFER_SIZE. The reason for doing so is that the 42 | * Java inflater sometimes reads beyond the EXI channel/block and 43 | * PushbackInputStream allows us to push back this data so that it is not lost. 44 | *
45 | * 46 | * @author Daniel.Peintner.EXT@siemens.com 47 | * @author Richard.Kuntschke@siemens.com 48 | * 49 | */ 50 | 51 | public interface EXIStreamDecoder { 52 | 53 | public EXIBodyDecoder getBodyOnlyDecoder(InputStream is) 54 | throws EXIException, IOException; 55 | 56 | public EXIBodyDecoder decodeHeader(InputStream is) throws EXIException, 57 | IOException; 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/EXIStreamEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core; 25 | 26 | import java.io.IOException; 27 | import java.io.OutputStream; 28 | 29 | import com.siemens.ct.exi.core.exceptions.EXIException; 30 | 31 | /** 32 | * An EXI stream is an EXI header followed by an EXI body. The EXI body carries 33 | * the content of the document, while the EXI header communicates the options 34 | * used for encoding the EXI body. 35 | * 36 | * @author Daniel.Peintner.EXT@siemens.com 37 | * @author Richard.Kuntschke@siemens.com 38 | * 39 | */ 40 | 41 | public interface EXIStreamEncoder { 42 | 43 | public EXIBodyEncoder encodeHeader(OutputStream os) throws EXIException, 44 | IOException; 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/SelfContainedHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core; 25 | 26 | import com.siemens.ct.exi.core.exceptions.EXIException; 27 | import com.siemens.ct.exi.core.io.channel.EncoderChannel; 28 | 29 | /** 30 | * The class allows you to keep track of selfContained elements. 31 | * 32 | * 33 | * @author Daniel.Peintner.EXT@siemens.com 34 | * @author Richard.Kuntschke@siemens.com 35 | * 36 | */ 37 | 38 | public interface SelfContainedHandler { 39 | 40 | /** 41 | * Receive notification of SC element. 42 | * 43 | * @param uri 44 | * namespaceURI of of SC element 45 | * @param localName 46 | * local-name of SC element 47 | * @param channel 48 | * encoder channel 49 | * 50 | * @throws EXIException 51 | * EXI exception 52 | */ 53 | public void scElement(String uri, String localName, EncoderChannel channel) 54 | throws EXIException; 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/attributes/AttributeFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.attributes; 25 | 26 | import com.siemens.ct.exi.core.EXIFactory; 27 | 28 | /** 29 | * Factory for creating attribute lists according to EXI Factory. 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class AttributeFactory { 37 | protected AttributeFactory() { 38 | } 39 | 40 | public static AttributeFactory newInstance() { 41 | return new AttributeFactory(); 42 | } 43 | 44 | public AttributeList createAttributeListInstance(EXIFactory exiFactory) { 45 | return new AttributeListImpl(exiFactory); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/attributes/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | Package to parse attributes. 13 | 14 |Availability to use different classes for XML documents and/or 15 | fragments.
16 | 17 |EXI uses a string table to assign "compact identifiers" to some 15 | string values. Occurrences of string values found in the string table 16 | are represented using the associated compact identifier rather than 17 | encoding the entire "string literal".
18 | 19 |30 | * If a EXI application needs to implement customized error handling, it must 31 | * implement this interface and then register an instance. 32 | *
33 | * 34 | * @author Daniel.Peintner.EXT@siemens.com 35 | * @author Richard.Kuntschke@siemens.com 36 | * 37 | */ 38 | 39 | public interface ErrorHandler { 40 | /** 41 | * Receive notification of a warning. 42 | * 43 | *44 | * Parsers will use this method to report conditions that are not errors. 45 | *
46 | * 47 | * 48 | * @param exception 49 | * The warning information encapsulated in a EXI exception. 50 | */ 51 | public void warning(EXIException exception); 52 | 53 | /** 54 | * Receive notification of a recoverable error. 55 | * 56 | * @param exception 57 | * The error information encapsulated in a EXI exception. 58 | */ 59 | public void error(EXIException exception); 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/exceptions/UnsupportedOption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.exceptions; 25 | 26 | /** 27 | * Unsupported option 28 | * 29 | * @author Daniel.Peintner.EXT@siemens.com 30 | * @author Richard.Kuntschke@siemens.com 31 | * 32 | */ 33 | 34 | public class UnsupportedOption extends EXIException { 35 | /** 36 | * 37 | */ 38 | private static final long serialVersionUID = -8859158367056532581L; 39 | 40 | public UnsupportedOption(String msg) { 41 | super(msg); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/exceptions/XMLParsingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.exceptions; 25 | 26 | /** 27 | * XML parsing exception. 28 | * 29 | * @author Daniel.Peintner.EXT@siemens.com 30 | * @author Richard.Kuntschke@siemens.com 31 | * 32 | */ 33 | 34 | public class XMLParsingException extends EXIException { 35 | 36 | /** 37 | * 38 | */ 39 | private static final long serialVersionUID = -1568757949406610062L; 40 | 41 | public XMLParsingException(String message) { 42 | super(message); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/exceptions/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI Exception collection. 13 | 14 |EXI events and associated content that occur in an EXI stream
15 | 16 |EXI is a knowledge based encoding that uses a set of grammars to 15 | determine which events are most likely to occur at any given point in an 16 | EXI stream and encodes the most likely alternatives in fewer bits. It 17 | does this by mapping the stream of events to a lower entropy set of 18 | representative values and encoding those values using a set of simple 19 | variable length codes or an EXI compression algorithm.
20 | 21 |An EXI Grammar Production consists of an EXI event and the next grammar following this event.
15 | 16 |33 | * Warnings and errors are simply ignored 34 | *
35 | * 36 | * @author Daniel.Peintner.EXT@siemens.com 37 | * @author Richard.Kuntschke@siemens.com 38 | * 39 | */ 40 | public class DefaultErrorHandler implements ErrorHandler { 41 | 42 | public void error(EXIException exception) { 43 | } 44 | 45 | public void warning(EXIException exception) { 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/helpers/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI helper classes such as default interface implementations. 13 | 14 |Events inside each block are multiplexed into channels.
15 | 16 |32 | * Additionally some built-in types are augmented with information necessary for 33 | * machine processing (e.g., number of bits). 34 | *
35 | * 36 | * @author Daniel.Peintner.EXT@siemens.com 37 | * @author Richard.Kuntschke@siemens.com 38 | * 39 | */ 40 | 41 | public enum BuiltInType { 42 | /** Binary Base64 */ 43 | BINARY_BASE64, 44 | 45 | /** Binary Hex */ 46 | BINARY_HEX, 47 | 48 | /** Boolean */ 49 | BOOLEAN, 50 | 51 | /** Boolean Facet */ 52 | BOOLEAN_FACET, 53 | 54 | /** Decimal */ 55 | DECIMAL, 56 | 57 | /** Float & Double */ 58 | FLOAT, 59 | 60 | /** N-Bit UnsignedInteger */ 61 | NBIT_UNSIGNED_INTEGER, 62 | 63 | /** Unsigned Integer */ 64 | UNSIGNED_INTEGER, 65 | 66 | /** (Signed) Integer */ 67 | INTEGER, 68 | 69 | /** Datetime */ 70 | DATETIME, 71 | 72 | /** String & RestrictedCharSet */ 73 | STRING, 74 | 75 | /** Restricted character set string */ 76 | RCS_STRING, 77 | 78 | /** 79 | * Experimental 80 | * (https://www.w3.org/XML/EXI/docs/extendedString/exi-extString.html) 81 | */ 82 | EXTENDED_STRING, 83 | 84 | /** Enumeration */ 85 | ENUMERATION, 86 | 87 | /** List */ 88 | LIST, 89 | 90 | /** QName */ 91 | QNAME; 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/DateTimeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | /** 27 | * The Date-Time datatype representation is a sequence of values representing 28 | * the individual components of the Date-Time 29 | * 30 | * @author Daniel.Peintner.EXT@siemens.com 31 | * @author Richard.Kuntschke@siemens.com 32 | * 33 | */ 34 | 35 | public enum DateTimeType { 36 | /** gYear represents a gregorian calendar year */ 37 | gYear, 38 | 39 | /** 40 | * gYearMonth represents a specific gregorian month in a specific gregorian 41 | * year 42 | */ 43 | gYearMonth, 44 | 45 | /** 46 | * A date is an object with year, month, and day properties just like those 47 | * of dateTime objects, plus an optional timezone-valued timezone property 48 | */ 49 | date, 50 | /** 51 | * dateTime values may be viewed as objects with integer-valued year, month, 52 | * day, hour and minute properties, a decimal-valued second property, and a 53 | * boolean timezoned property. 54 | */ 55 | dateTime, 56 | 57 | /** gMonth is a gregorian month that recurs every year */ 58 | gMonth, 59 | 60 | /** 61 | * gMonthDay is a gregorian date that recurs, specifically a day of the year 62 | * such as the third of May 63 | */ 64 | gMonthDay, 65 | 66 | /** 67 | * gDay is a gregorian day that recurs, specifically a day of the month such 68 | * as the 5th of the month 69 | */ 70 | gDay, 71 | 72 | /** time represents an instant of time that recurs every day */ 73 | time; 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/IntegerType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | /** 27 | * EXI can deal with arbitrary large integers have values. This integer-type 28 | * informs about the type declared in the schema. 29 | * 30 | * @author Daniel.Peintner.EXT@siemens.com 31 | * @author Richard.Kuntschke@siemens.com 32 | * 33 | */ 34 | 35 | public enum IntegerType { 36 | /** Unsigned Integer with at most 8 bits */ 37 | UNSIGNED_INTEGER_8(true), 38 | 39 | /** Unsigned Integer with at most 16 bits */ 40 | UNSIGNED_INTEGER_16(true), 41 | 42 | /** Unsigned Integer with at most 32 bits */ 43 | UNSIGNED_INTEGER_32(true), 44 | 45 | /** Unsigned Integer with at most 64 bits */ 46 | UNSIGNED_INTEGER_64(true), 47 | 48 | /** Unsigned Integer with arbitrary number of bits */ 49 | UNSIGNED_INTEGER_BIG(true), 50 | 51 | /** Integer with at most 8 bits */ 52 | INTEGER_8(false), 53 | 54 | /** Integer with at most 16 bits */ 55 | INTEGER_16(false), 56 | 57 | /** Integer with at most 32 bits */ 58 | INTEGER_32(false), 59 | 60 | /** Integer with at most 64 bits */ 61 | INTEGER_64(false), 62 | 63 | /** Integer with arbitrary number of bits */ 64 | INTEGER_BIG(false); 65 | 66 | private final boolean isUnsigned; 67 | 68 | private IntegerType(boolean isUnsigned) { 69 | this.isUnsigned = isUnsigned; 70 | } 71 | 72 | public boolean isUnsigned() { 73 | return isUnsigned; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/StringTypeDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | import java.io.IOException; 27 | 28 | import com.siemens.ct.exi.core.context.QNameContext; 29 | import com.siemens.ct.exi.core.datatype.Datatype; 30 | import com.siemens.ct.exi.core.datatype.strings.StringDecoder; 31 | import com.siemens.ct.exi.core.exceptions.EXIException; 32 | import com.siemens.ct.exi.core.io.channel.DecoderChannel; 33 | import com.siemens.ct.exi.core.values.Value; 34 | 35 | /** 36 | * 37 | * @author Daniel.Peintner.EXT@siemens.com 38 | * @author Richard.Kuntschke@siemens.com 39 | * 40 | */ 41 | 42 | public class StringTypeDecoder extends AbstractTypeDecoder { 43 | 44 | public StringTypeDecoder() throws EXIException { 45 | super(); 46 | } 47 | 48 | public Value readValue(Datatype datatype, QNameContext qnContext, 49 | DecoderChannel valueChannel, StringDecoder stringDecoder) 50 | throws IOException { 51 | return stringDecoder.readValue(qnContext, valueChannel); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/StringTypeEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | import java.io.IOException; 27 | 28 | import com.siemens.ct.exi.core.context.QNameContext; 29 | import com.siemens.ct.exi.core.datatype.Datatype; 30 | import com.siemens.ct.exi.core.datatype.strings.StringEncoder; 31 | import com.siemens.ct.exi.core.exceptions.EXIException; 32 | import com.siemens.ct.exi.core.io.channel.EncoderChannel; 33 | import com.siemens.ct.exi.core.values.Value; 34 | 35 | /** 36 | * 37 | * @author Daniel.Peintner.EXT@siemens.com 38 | * @author Richard.Kuntschke@siemens.com 39 | * 40 | */ 41 | 42 | public class StringTypeEncoder extends AbstractTypeEncoder { 43 | 44 | String lastValidValue; 45 | 46 | public StringTypeEncoder() throws EXIException { 47 | super(); 48 | } 49 | 50 | public boolean isValid(Datatype datatype, Value value) { 51 | lastValidValue = value.toString(); 52 | return true; 53 | } 54 | 55 | public void writeValue(QNameContext qnContext, EncoderChannel valueChannel, 56 | StringEncoder stringEncoder) throws IOException { 57 | stringEncoder.writeValue(qnContext, valueChannel, lastValidValue); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/TypeCoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public interface TypeCoder { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/TypeDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | import java.io.IOException; 27 | 28 | import com.siemens.ct.exi.core.context.QNameContext; 29 | import com.siemens.ct.exi.core.datatype.Datatype; 30 | import com.siemens.ct.exi.core.datatype.strings.StringDecoder; 31 | import com.siemens.ct.exi.core.io.channel.DecoderChannel; 32 | import com.siemens.ct.exi.core.values.Value; 33 | 34 | /** 35 | * 36 | * @author Daniel.Peintner.EXT@siemens.com 37 | * @author Richard.Kuntschke@siemens.com 38 | * 39 | */ 40 | 41 | public interface TypeDecoder extends TypeCoder { 42 | 43 | public Value readValue(Datatype datatype, QNameContext qnContext, 44 | DecoderChannel valueChannel, StringDecoder stringDecoder) 45 | throws IOException; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/TypeEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | import java.io.IOException; 27 | 28 | import com.siemens.ct.exi.core.context.QNameContext; 29 | import com.siemens.ct.exi.core.datatype.Datatype; 30 | import com.siemens.ct.exi.core.datatype.strings.StringEncoder; 31 | import com.siemens.ct.exi.core.io.channel.EncoderChannel; 32 | import com.siemens.ct.exi.core.values.Value; 33 | 34 | /** 35 | * 36 | * @author Daniel.Peintner.EXT@siemens.com 37 | * @author Richard.Kuntschke@siemens.com 38 | * 39 | */ 40 | 41 | public interface TypeEncoder extends TypeCoder { 42 | 43 | /** 44 | * Checks whether given value is valid according to the datatype. 45 | * 46 | * @param datatype 47 | * datatype 48 | * @param value 49 | * value 50 | * @return boolean value indicating whether passed value is valid 51 | */ 52 | public boolean isValid(Datatype datatype, Value value); 53 | 54 | /** 55 | * Writes previously checked valid value to channel. 56 | * 57 | * @param qnContext 58 | * context 59 | * @param valueChannel 60 | * encoder value channel 61 | * @param stringEncoder 62 | * string encoder 63 | * @throws IOException 64 | * IO exception 65 | */ 66 | public void writeValue(QNameContext qnContext, EncoderChannel valueChannel, 67 | StringEncoder stringEncoder) throws IOException; 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 9 | 10 | 11 | 12 | EXI Types and Type coding modes such as Typed, String, Lexical and RepresentationMap. 13 | 14 |is an open source implementation of the W3C Efficient XML Interchange (EXI) format specification written in the Java programming language 25 | (http://exificient.github.io). 26 |
27 | 28 |
The EXI format is a very compact representation for the Extensible Markup Language (XML) Information Set that is intended to simultaneously optimize performance and the utilization of computational resources. 29 |
30 | 31 | 32 | 33 | --------------------------------------------------------------------------------