1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. 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, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 package org.apache.openoffice.ooxml.schema.model.simple; 23 24 import java.util.Vector; 25 26 import org.apache.openoffice.ooxml.schema.model.base.INodeVisitor; 27 import org.apache.openoffice.ooxml.schema.model.base.Location; 28 import org.apache.openoffice.ooxml.schema.model.base.Node; 29 import org.apache.openoffice.ooxml.schema.model.base.NodeType; 30 import org.apache.openoffice.ooxml.schema.model.base.QualifiedName; 31 32 /** Representation of built in types. 33 */ 34 public class BuiltIn 35 extends SimpleType 36 { GetTypes()37 public static Vector<BuiltIn> GetTypes () 38 { 39 final Vector<BuiltIn> aTypes = new Vector<>(); 40 for (final BuiltInType eType : BuiltInType.values()) 41 aTypes.add(new BuiltIn(eType)); 42 return aTypes; 43 } 44 45 46 47 BuiltIn( final BuiltInType eType)48 protected BuiltIn ( 49 final BuiltInType eType) 50 { 51 super(null, eType.GetQualifiedName(), new Location()); 52 meType = eType; 53 } 54 55 56 57 58 @Override GetNodeType()59 public NodeType GetNodeType () 60 { 61 return NodeType.BuiltIn; 62 } 63 64 65 66 GetBuiltInType()67 public BuiltInType GetBuiltInType () 68 { 69 return meType; 70 } 71 72 73 74 75 @Override AcceptVisitor(final INodeVisitor aVisitor)76 public void AcceptVisitor (final INodeVisitor aVisitor) 77 { 78 aVisitor.Visit(this); 79 } 80 81 82 83 84 @Override toString()85 public String toString () 86 { 87 return "builtin "+GetName().GetDisplayName(); 88 } 89 90 91 92 93 private final BuiltInType meType; 94 95 96 97 GetForName(QualifiedName aName)98 public static Node GetForName(QualifiedName aName) 99 { 100 // TODO Auto-generated method stub 101 return null; 102 } 103 } 104