| 1 | /* |
|---|
| 2 | * Copyright 2009, Plutext Pty Ltd. |
|---|
| 3 | * |
|---|
| 4 | * This file is part of docx4j. |
|---|
| 5 | |
|---|
| 6 | docx4j is licensed under the Apache License, Version 2.0 (the "License"); |
|---|
| 7 | you may not use this file except in compliance with the License. |
|---|
| 8 | |
|---|
| 9 | You may obtain a copy of the License at |
|---|
| 10 | |
|---|
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
|---|
| 12 | |
|---|
| 13 | Unless required by applicable law or agreed to in writing, software |
|---|
| 14 | distributed under the License is distributed on an "AS IS" BASIS, |
|---|
| 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|---|
| 16 | See the License for the specific language governing permissions and |
|---|
| 17 | limitations under the License. |
|---|
| 18 | |
|---|
| 19 | */ |
|---|
| 20 | package org.docx4j.model; |
|---|
| 21 | |
|---|
| 22 | import javax.xml.bind.JAXBException; |
|---|
| 23 | import javax.xml.transform.TransformerException; |
|---|
| 24 | |
|---|
| 25 | import org.apache.log4j.Logger; |
|---|
| 26 | import org.docx4j.XmlUtils; |
|---|
| 27 | import org.docx4j.wml.R.Sym; |
|---|
| 28 | import org.w3c.dom.Node; |
|---|
| 29 | import org.w3c.dom.NodeList; |
|---|
| 30 | |
|---|
| 31 | public class SymbolModel extends Model { |
|---|
| 32 | private final static Logger log = Logger.getLogger(SymbolModel.class); |
|---|
| 33 | |
|---|
| 34 | private Sym sym; |
|---|
| 35 | /** |
|---|
| 36 | * @return the sym |
|---|
| 37 | */ |
|---|
| 38 | public Sym getSym() { |
|---|
| 39 | return sym; |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | @Override |
|---|
| 43 | public void build(Node node, NodeList children) throws TransformerException { |
|---|
| 44 | |
|---|
| 45 | try { |
|---|
| 46 | sym = (Sym) XmlUtils.unmarshal(node); |
|---|
| 47 | } catch (JAXBException e) { |
|---|
| 48 | throw new TransformerException("Node: " + node.getNodeName() + "=" |
|---|
| 49 | + node.getNodeValue(), e); |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | @Override |
|---|
| 55 | public Object toJAXB() { |
|---|
| 56 | // TODO Auto-generated method stub |
|---|
| 57 | return null; |
|---|
| 58 | } |
|---|
| 59 | |
|---|
| 60 | public static class SymbolModelTransformState implements TransformState { } |
|---|
| 61 | |
|---|
| 62 | } |
|---|